import { post, postFormData, postT, postSeafile, postFormDataSeafile } from './post.js';
import { get, getT, getSeafile } from './get.js';
import { put, putT } from './put.js';
import { del, delT, delSeafile } from './delete.js';
import Cookies from 'js-cookie';
import config from '../config/index';

const statistic_pwd = '';
const origin_ios_wx_url = location.href.split('#')[0];

const baseUrl = config.ncmesUrl;
const baseUrl1 = config.pdcapiUrl;
const baseUrl2 = config.deviceapi;
const newDeviceUrl = config.newdeviceapi;
const wxUrl = config.wxUrl;
const statistics_url = config.statistics_url;
const baseUrl3 = config.onlineOLhelpSearchUrl;
const textUrl = config.onlinehelp;
const backUrl = config.oss_url;
const leaseapi = config.leaseapi;
const controlUrl = config.controlurl;
const pdcapiUrl = baseUrl1 + 'setting';
const friendsUrl = config.friends_url;
const experimentUrl = config.experimentUrl;
const maintainUrl = config.maintainUrl;
const capiUrl = config.capiUrl;
const ledgerUrl = config.ledgerUrl;
const seafileUrl = config.seafileUrl;
const purchaseUrl = config.purchaseUrl;
const customerUrl = config.customerUrl;
const inventorymanageUrl = config.inventorymanageUrl;
const ncmsgUrl = config.ncmsgUrl;
const diagnosisUrl = config.diagnosisUrl;
const processstoreUrl = config.processstoreUrl;
const maintainctrlUrl = config.maintainctrlUrl;
const dataanalysisUrl = config.dataanalysisUrl;
// const enterpriseUrl = config.enterpriseUrl;

const Interface = {
    // 微信相关
    jssdksignature: wxUrl + 'jssdksignature',
    //  1、注册的请求接口
    registerAjax: baseUrl + 'web/register',
    //  2、登录验证码请求接口
    vercodeAjax: wxUrl + 'login/vercode',
    //  3、登录接口请求
    loginAjax: baseUrl + 'web/login',
    //  4、忘记密码
    forgotPwd: baseUrl + 'forgot/password',
    //  5、修改密码
    modifyPwd: baseUrl + 'modify/password',
    //  6、个人信息
    userData: baseUrl + 'user',
    //  7、修改个人信息
    modifyUserData: baseUrl + 'user',
    //  8、获取全部设备
    allMachines: baseUrl + 'focusmachine',
    //  9、删除设备
    removeMachines: baseUrl + 'focusmachine',
    //  10、是否关注设备
    focusMachines: baseUrl + 'focusmachine/enable',
    //  11、添加设备
    addMachines: baseUrl + 'web/focusmachine',
    //  12、获取全部设备参数列表参数
    homeLists: baseUrl1 + 'template/paramslist',
    // 当在移动端的时候，点击左侧菜单，隐鲹整个菜单
    //  12、保存首页参数
    saveHomeParameters: baseUrl + 'focusmachine/item',
    //  13、获取详情页设备参数列表
    getHomeParameters: baseUrl1 + 'web/home/paramlist',
    //  14、删除详情页某个参数
    rmParameters: baseUrl1 + 'web/home/paramone',
    //  15、注册验证码
    registerVercode: wxUrl + 'vercode',
    //  16、添加设备参数的列表
    getDetailMachineParemeter: baseUrl1 + 'web/home/param',
    //  17、保存详细页的参数
    saveDetailMachineParemeter: baseUrl1 + 'web/home/paramadd',
    //  18、保存智能报警、工作状态
    saveIntelligentAlarm: baseUrl1 + 'web/config/setdata',
    //  19、获取设定的智能报警数值、工作状态
    getIntelligentAlarm: baseUrl1 + 'web/config/getdata',
    //  20、保存新建模板名称
    saveTempName: baseUrl + 'web/displayboard/newboard',
    //  21、获取已经保存到模板名称
    getTempName: baseUrl + 'web/displayboard/getboardname',
    //  22、新建展板时，添加设备或者删除设备
    newTempAddMachineOrRmMachine: baseUrl + 'web/displayboard/addparams',
    //  23、获取新建展板的设备，并以磁贴展示出来
    getNewTempMachime: baseUrl + 'web/displayboard/getboardparams',
    //  24、删除展板
    deleteTemp: baseUrl + 'web/displayboard/getboardname',
    //  25、获取历史消息
    getHistoryMsgs: baseUrl2 + 'device/focusmachine/fivealarm',
    //  26、获取关注设备
    getFocusMachines: baseUrl + 'focusmachinelist',
    // 帮助文档==================================================================
    // 获去产品目录
    getProductCatalog: baseUrl3 + 'getAllCatalog',
    // 添加产品目录
    addProductCatalog: baseUrl3 + 'saveCatalog',
    // 搜索产品目录
    searchProductCatalog: baseUrl3 + 'searchBookName',
    // 获取个人添加的书籍
    getPersonProduct: baseUrl3 + 'myCatalog',
    // 删除个人书籍
    rmPersonProduct: baseUrl3 + 'deleteCatalog',
    // 获取一级目录
    getFirstLevel: baseUrl3 + 'getCatalogIndex',
    // 获取二级目录
    getSecondLevel: baseUrl3 + 'secondcons',
    // 获取3级目录
    getThirdLevel: baseUrl3 + 'thirdcons',
    // 搜索
    search: baseUrl3 + 'thirdcons',
    // 搜帮助文档
    searchHelpPage: baseUrl3 + 'getTitleAndHtmlUrl?',
    // 收藏文章借口
    clipArticle: baseUrl3 + 'storeup?',
    // 点赞
    ThumbUp: baseUrl3 + 'laud?',
    // 获取是否点赞和收藏
    ThumbUpAndCollectionStatus: baseUrl3,
    //= ======================================================================
    // 进来加载我的收藏
    myCollection: baseUrl3 + 'mystore?',
    // 搜索我的收藏
    searchMystore: baseUrl3 + 'searchMystore?',
    // 获取到关键词
    getKeyWord: baseUrl3 + 'getkeyworlds',
    // 效率分析
    efficiency: baseUrl2 + 'time_efficiency',
    // 格式化数据
    fomatData: baseUrl1 + 'web/home/allparam',
    // 轮播设置
    scrollSet: baseUrl1 + 'user/Scrolldisplay/setting',
    // 轮播设置参数
    scrollList: baseUrl1 + 'user/Scrolldisplay/paramlist',
    // 设备别名设置
    setalias: baseUrl + 'focusmachine/alias',
    // 时区设置
    settimezone: statistics_url + 'modifytimezone',
    // 修改手机
    modify_phone: baseUrl + 'modify/phone',

    ratelife: pdcapiUrl + '/wear',
    weardata: pdcapiUrl + '/weardata',
    perweardata: pdcapiUrl + '/uuid',
    intelalarmdata: pdcapiUrl + '/alarmdata',
    oldintelalarmdata: baseUrl2 + 'intelalarm',
    oldinfoalarmdata: baseUrl2 + 'devicealarm',
    onlineHelpOffer: config.onlinehelp + 'feed/saveimg',
    onlinehelp: config.onlinehelp + 'feed/onlinerepair',
    alarmenable: config.alarmEnableUrl,

    // 新建工具
    tool: baseUrl1 + 'tool',
    disabletool: baseUrl1 + 'tool/disable',
    disposetool: baseUrl1 + 'tool/scrap',
    enabletool: baseUrl1 + 'tool/enable',
    viewtool: baseUrl1 + 'tool/one',
    toolcode: baseUrl1 + 'tool/tcode',
    toollog: baseUrl1 + 'tool/log',
    // 获取设备在线
    deviceonline: baseUrl2 + 'whc/deviceinfos/enable',
    // 租赁服务
    leasegroup: leaseapi + 'service',
    leaseserviceone: leaseapi + 'service/one',
    getleaseid: leaseapi + 'service/getid',
    leaseserviceon: leaseapi + 'service/on',
    leaseserviceoff: leaseapi + 'service/off',
    effect_list_service: leaseapi + 'service/effect',
    // 租赁设备
    lease_service_auth: leaseapi + 'lease/checkpermission',
    leasedevice: leaseapi + 'device',
    lease_all_device: leaseapi + 'alldevice',
    lease_device_onhire: leaseapi + 'device/onhire',
    lease_device_offhire: leaseapi + 'device/offhire',

    rentid: leaseapi + 'lease/getid',
    rent: leaseapi + 'lease',
    startrent: leaseapi + 'lease/establish',
    cancelrent: leaseapi + 'lease/cancel',
    onerent: leaseapi + 'lease/one',

    getallprice: leaseapi + 'lease/gettotalprice',
    // 获取设备的统计数值
    getleasedevicenum: leaseapi + 'device/getnums',
    all_lease_uuid: leaseapi + 'device/uuids',
    // 下载压缩文件
    qrcode_zipurl: leaseapi + 'service/loadcodes',

    get_off_lease_num: leaseapi + 'lease/applynum',
    clear_service_devices: leaseapi + 'lease/clear_service_devices',

    // 工艺文件管理
    // control api
    filegroups: 'filegroups',
    filegroup: 'filegroup',
    groupfiles: '/group/fileinfos',
    file: 'file',
    allfile: 'allfileinfos',
    searchfile: 'search/fileinfos',
    files: 'filesetting',
    filedownload: '/file/download',
    fileedit: '/file/edit',
    down_file_to_device: 'file/issue',

    // 好友管理
    friend_group: friendsUrl + 'group',
    friends_of_group: friendsUrl + '/user/group',
    friend: friendsUrl + '/user',
    friend_apply_me: friendsUrl + '/user/appuser',
    friend_agree: friendsUrl + '/user/agree',
    friend_refuse: friendsUrl + 'user/refuse',
    check_friend: friendsUrl + '/user/checkaccount',
    apply_data: friendsUrl + '/user/oneappuser',
    friend_user: friendsUrl + '/user/oneuser',
    copy_friend: friendsUrl + '/user/copyuser',
    del_friend_fromgroup: friendsUrl + '/user/removeuser',

    join_other: friendsUrl + 'user/others',
    friend_unconfirm_user: friendsUrl + '/user/unconfirmfriend',
    friend_user_alluser: friendsUrl + 'user/alluser',

    // 可靠性评估
    exprecord_new: experimentUrl + '/exprecord/new',
    exprecord_modifystatus: experimentUrl + '/exprecord/modifystatus',
    exprecord_filter: experimentUrl + '/exprecord/filter',
    exprecord_detail: experimentUrl + 'exprecord/detail',
    exprecord_log: experimentUrl + 'exprecord/log',
    exprecord_modifyinfo: experimentUrl + 'exprecord/modifyinfo',
    exprecord_checktruncated: experimentUrl + 'exprecord/checktruncated',
    device_add: experimentUrl + 'device/add',
    device_delete: experimentUrl + 'device/delete',
    member_add: experimentUrl + 'member/add',
    member_delete: experimentUrl + 'member/delete',
    timerange_new: experimentUrl + 'timerange/new',
    timerange_filter: experimentUrl + 'timerange/filter',
    timerange_modifystatus: experimentUrl + 'timerange/modifystatus',
    timerange_modifycontent: experimentUrl + 'timerange/modifycontent',
    timerange_detail: experimentUrl + 'timerange/detail',
    fault_new: experimentUrl + 'fault/new',
    fault_filter: experimentUrl + 'fault/filter',
    fault_modifystatus: experimentUrl + 'fault/modifystatus',
    fault_detail: experimentUrl + 'fault/detail',
    fault_modifycontent: experimentUrl + 'fault/modifycontent',
    premaintain_new: experimentUrl + 'premaintain/new',
    premaintain_filter: experimentUrl + 'premaintain/filter',
    premaintain_modifystatus: experimentUrl + 'premaintain/modifystatus',
    premaintain_modifycontent: experimentUrl + 'premaintain/modifycontent',
    premaintain_detail: experimentUrl + 'premaintain/detail',
    device_detail: experimentUrl + 'device/detail',
    device_modifyinfo: experimentUrl + 'device/modifyinfo',
    report_all: experimentUrl + 'report/all',
    report_create: experimentUrl + 'report/create',
    report_delete: experimentUrl + 'report/delete',
    report_download: experimentUrl + 'report/download',

    // 应用
    pdc_allapps: baseUrl1 + 'ncapp/allapps',
    pdc_selfapp: baseUrl1 + 'ncapp/selfapp',
    pdc_allselfapp: baseUrl1 + 'ncapp/allselfapp',
    pdc_checkappauth: baseUrl1 + 'ncapp/checkappauth',
    pdc_allmyapps: baseUrl1 + 'ncapp/allmyapps',
    pdc_homepage: baseUrl1 + 'user/homepage',
    pdc_commonused_set: baseUrl1 + 'ncapp/commonused/set',
    pdc_commonused: baseUrl1 + 'ncapp/commonused',
    pdc_allselfapp_commonused: baseUrl1 + 'ncapp/allselfapp/commonused',
    pdc_allselfapp_homepage: baseUrl1 + 'ncapp/allselfapp/homepage',
    pdc_submenus_menuurl: baseUrl1 + 'ncapp/submenus/menuurl',
    pdc_submenu_check: baseUrl1 + 'ncapp/submenu/check',
    pdc_selfapp_remotemonitor: baseUrl1 + 'ncapp/selfapp/remotemonitor',
    pdc_oneselfapp: baseUrl1 + 'ncapp/oneselfapp',
    pdc_inaccessibleurl: baseUrl1 + 'ncapp/inaccessibleurl',

    // 获取预加载设备数据
    pre_load_param: newDeviceUrl + '/device/status/paramsvalues',

    // 获取单个设备所有数据
    pre_one_device_param_value: newDeviceUrl + '/device/whc/status/oneuuid',

    // 分享文件至好友
    share_file_to_friend: controlUrl + '/file/share',

    // 设置语言
    set_language: baseUrl + '/user/language',

    // 获取登录二维码id
    get_login_qrcodeid: baseUrl + '/login/qrcode',

    // 检查登录二维码扫码状态
    check_login_qrcode: `${baseUrl}/login/qrcode/check`,

    // 设备绑定
    focusmachine_users: baseUrl + 'focusmachine/users',
    focusmachine_admin: baseUrl + 'focusmachine/admin',
    focusmachine_web_admin: baseUrl + 'focusmachine/web/admin',

    // 维检计划
    maintain_plan_all: maintainUrl + '/plan/all',
    maintain_plan: maintainUrl + 'plan',
    maintain_plan_recv: maintainUrl + '/plan/recv',
    maintain_plan_shield: maintainUrl + 'plan/shield',
    maintain_plan_one: maintainUrl + 'plan/one',
    maintain_plan_attachment: maintainUrl + 'plan/attachment',
    // 维检任务
    maintain_task_all: maintainUrl + 'task/all',
    maintain_task: maintainUrl + 'task',
    maintain_task_relay: maintainUrl + 'task/relay',
    maintain_task_commit: maintainUrl + 'task/commit',
    maintain_task_complete: maintainUrl + 'task/complete',
    maintain_task_close: maintainUrl + 'task/close',
    maintain_task_reopen: maintainUrl + 'task/reopen',
    maintain_task_remark: maintainUrl + 'task/remark',
    maintain_task_one: maintainUrl + 'task/one',
    maintain_task_managelogs: maintainUrl + 'task/managelogs',
    maintain_task_commit_receivers: maintainUrl + 'task/commit/receivers',
    maintain_setting: maintainUrl + 'setting',
    // 故障报修
    maintain_repair_all: maintainUrl + 'repair/all',
    maintain_repair: maintainUrl + 'repair',
    maintain_repair_one: maintainUrl + 'repair/one',
    maintain_repair_relay: maintainUrl + 'repair/relay',
    maintain_repair_complete: maintainUrl + 'repair/complete',
    maintain_repair_close: maintainUrl + 'repair/close',
    maintain_repair_remark: maintainUrl + 'repair/remark',
    maintain_repair_reopen: maintainUrl + 'repair/reopen',
    maintain_repair_commit: maintainUrl + 'repair/commit',
    maintain_repair_commit_receivers: maintainUrl + 'repair/commit/receivers',
    maintain_repair_managelogs: maintainUrl + 'repair/managelogs',
    // 维检工单
    maintain_check_getlist: maintainctrlUrl + '/maintainworkorder/getlist', // 获取维检工单列表
    maintaincheckorder_transfer: maintainctrlUrl + '/maintainworkorder/transfer', // 转派工单
    // 通用附件接口
    capi_common_file: capiUrl + 'common/file',
    capi_common_some_file: capiUrl + '/common/file/some',

    // 设备台账
    deviceledger_add: ledgerUrl + 'add',
    deviceledger_bind: ledgerUrl + 'bind',
    deviceledger_one: ledgerUrl + 'one',
    deviceledger_unbind: ledgerUrl + 'unbind',
    deviceledger_edit: ledgerUrl + 'edit',
    deviceledger_modifyalias: ledgerUrl + 'modifyalias',
    deviceledger_addlock: ledgerUrl + 'addlock',
    deviceledger_removelock: ledgerUrl + 'removelock',
    deviceledger_modifyuuid: ledgerUrl + 'modifyuuid',
    deviceledger_all: ledgerUrl + 'all',
    deviceledger_allbypage: ledgerUrl + 'allbypage',
    deviceledger_filter: ledgerUrl + 'filter',
    deviceledger_base: ledgerUrl + 'base',
    deviceledger_detail: ledgerUrl + 'detail',
    // 设备网盘
    seafile_token: controlUrl + 'seafile/token',
    seafile_fromprocessfile: controlUrl + 'seafile/fromprocessfile',
    seafile_toprocessfile: controlUrl + 'seafile/toprocessfile',
    seafile_api2_repos: seafileUrl + 'api2/repos/',
    seafile_api21_repos: seafileUrl + 'api/v2.1/repos/',
    seafile_api21_queryzipprogress: seafileUrl + 'api/v2.1/query-zip-progress/',
    seafile_api21_repos_batch_delete_item: seafileUrl + 'api/v2.1/repos/batch-delete-item/',
    seafile_api2_account_info: seafileUrl + 'api2/account/info/',
    // 第三方设备接入
    selfregmachine_reguuid: baseUrl + 'selfregmachine/reguuid',
    deviceledger_logout: ledgerUrl + 'logout',
    // 设备模型
    device_property_all: baseUrl + 'device/property/all',
    device_property: baseUrl + 'device/property',
    device_topic_all: baseUrl + 'device/topic/all',
    device_property_one: baseUrl + 'device/property/one',

    // 客户相关
    customer_list_url: customerUrl + '/customerroster',
    customer_list_one_url: customerUrl + '/customerroster/one',
    all_customer_list_url: customerUrl + '/customerroster/all',
    customer_list_alias: customerUrl + '/customerroster/alias',
    change_customer_admin: customerUrl + '/customerroster/changeadmin',
    customer_sharer: customerUrl + '/customerroster/share',
    agree_customer_share: customerUrl + '/customerroster/receiveroster',
    cancel_customer_users: customerUrl + '/customerroster/undochangeadmin',
    customer_list_opt_log: customerUrl + '/customerroster/operatelog',

    customer_record_url: customerUrl + '/customerrecord',
    customer_record_exit: customerUrl + '/customerroster/exit',
    customer_record_find_url: customerUrl + '/customerrecord/find',
    customer_record_logic_del: customerUrl + '/customerrecord/logic',
    customer_record_restore: customerUrl + '/customerrecord/restore',
    customer_record_one: customerUrl + '/customerrecord/one',
    customer_list_label: customerUrl + '/customerrecord/label',
    customer_list_users: customerUrl + '/customerroster/rostermember',
    // 导出
    customer_list_record_export: customerUrl + '/customerrecord/exportrecord',
    customer_list_record_import: customerUrl + '/customerrecord/importrecord',
    customer_list_record_template: customerUrl + '/customerroster/loadtemplate',

    message_service: ncmsgUrl + 'ncmessage',
    message_all_service: ncmsgUrl + 'ncmessage/all',
    message_calendar: ncmsgUrl + 'calendar',
    message_calendar_todolist: ncmsgUrl + 'calendar/todolist',
    message_calendar_status: ncmsgUrl + 'calendar/status',

    // 库存管理
    inventorymanage_warehouse_all: inventorymanageUrl + 'warehouse/all',
    inventorymanage_warehouse: inventorymanageUrl + 'warehouse',
    inventorymanage_warehouse_one: inventorymanageUrl + 'warehouse/one',
    inventorymanage_warehouse_alias: inventorymanageUrl + 'warehouse/alias',
    inventorymanage_warehouse_share: inventorymanageUrl + 'warehouse/share',
    inventorymanage_warehouse_sharedusers_bypage: inventorymanageUrl + 'warehouse/sharedusers/bypage',
    inventorymanage_warehouse_sharedusers_list: inventorymanageUrl + 'warehouse/sharedusers/list',
    inventorymanage_warehouse_shareduser: inventorymanageUrl + 'warehouse/shareduser',
    inventorymanage_warehouse_adminuser: inventorymanageUrl + 'warehouse/adminuser',
    inventorymanage_warehouse_all_list_admin: inventorymanageUrl + 'warehouse/all/list/admin',
    inventorymanage_warehouse_adminuser_cancel: inventorymanageUrl + 'warehouse/adminuser/cancel',
    inventorymanage_material_one: inventorymanageUrl + 'material/one',
    inventorymanage_material_all_bypage: inventorymanageUrl + 'material/all/bypage',
    inventorymanage_material_all_bycodename: inventorymanageUrl + 'material/all/bycodename',
    inventorymanage_material_deactivate: inventorymanageUrl + 'material/deactivate',
    inventorymanage_material_activate: inventorymanageUrl + 'material/activate',
    inventorymanage_material_bom_one: inventorymanageUrl + 'material/bom/one',
    inventorymanage_material_bom_import: inventorymanageUrl + 'material/bom/import',
    inventorymanage_material_bom_list: inventorymanageUrl + 'material/bom/list',
    inventorymanage_material_import: inventorymanageUrl + 'material/import',
    inventorymanage_flow_define_list: inventorymanageUrl + 'flow/define/list',
    inventorymanage_flow_define_one: inventorymanageUrl + 'flow/define/one',
    inventorymanage_flow_define_handler: inventorymanageUrl + 'flow/define/handler',
    inventorymanage_flow_manage_all: inventorymanageUrl + 'flow/manage/all',
    inventorymanage_flow_manage_initiate: inventorymanageUrl + 'flow/manage/initiate',
    inventorymanage_flow_manage_one: inventorymanageUrl + 'flow/manage/one',
    inventorymanage_flow_manage_logs: inventorymanageUrl + 'flow/manage/logs',
    inventorymanage_flow_manage_refuse: inventorymanageUrl + 'flow/manage/refuse',
    inventorymanage_flow_manage_one_simple: inventorymanageUrl + 'flow/manage/one/simple',
    inventorymanage_flow_manage_approve: inventorymanageUrl + 'flow/manage/approve',
    inventorymanage_flow_manage_reinitiate: inventorymanageUrl + 'flow/manage/reinitiate',
    inventorymanage_flow_node_prenodes: inventorymanageUrl + 'flow/node/prenodes',
    inventorymanage_flow_sponsors: inventorymanageUrl + 'flow/sponsors',
    inventorymanage_inventory_bitches_bymtcode: inventorymanageUrl + 'inventory/bitches/bymtcode',
    inventorymanage_inventory_all: inventorymanageUrl + 'inventory/all',
    inventorymanage_warehouse_checkadmin: inventorymanageUrl + 'warehouse/checkadmin',

    // 购买相关
    find_apps_have_spu: purchaseUrl + 'product/appshavespu',
    find_functions_in_app: purchaseUrl + 'product/inapp',
    find_all_sku_params: purchaseUrl + 'product/allSkuParams',
    find_one_spu: purchaseUrl + 'product/onespu',
    find_function_open_status: purchaseUrl + 'product/function',
    check_purchase_order: purchaseUrl + 'order/check',
    create_purchase_order: purchaseUrl + 'order/create',
    wxprepay_purchase_order: purchaseUrl + 'order/wxprepay/NATIVE',
    find_order_detail: purchaseUrl + 'order/one',
    pay_free_order: purchaseUrl + 'order/freepay',
    user_max_device_count: wxUrl + 'user/maxdevicecount',
    user_ledger_count: ledgerUrl + 'count',
    find_deviceexpan_order: purchaseUrl + 'product/deviceexpan',
    change_deviceexpan_time: purchaseUrl + 'order/changetime',
    find_opened_function: purchaseUrl + 'product/functionopen',
    find_orders: purchaseUrl + 'order/find',
    cancel_order: purchaseUrl + 'order/cancel',
    find_feedbacks: purchaseUrl + 'feedback/find',
    withdraw_feedback: purchaseUrl + 'feedback/withdraw',
    add_feedback: purchaseUrl + 'feedback/add',
    get_invoicable_order: purchaseUrl + 'invoice/invoicableorder',
    find_invoice: purchaseUrl + 'invoice/find',
    get_invoice_detail: purchaseUrl + 'invoice/detail',
    apply_invoice: purchaseUrl + 'invoice/apply',
    apply_elec_invoice: purchaseUrl + 'invoice/applyelec',
    find_invoice_title: purchaseUrl + 'invoicetitle/find',
    add_invoice_title: purchaseUrl + 'invoicetitle/add',
    delete_invoice_title: purchaseUrl + 'invoicetitle/one',
    edit_invoice_title: purchaseUrl + 'invoicetitle/edit',

    // 设备诊断
    diagnosis_realtime_paramsset: diagnosisUrl + 'realtime/paramsset',
    diagnosis_realtime_start: diagnosisUrl + 'realtime/start',
    diagnosis_realtime_end: diagnosisUrl + 'realtime/end',
    diagnosis_record: diagnosisUrl + 'record',
    diagnosis_record_end: diagnosisUrl + 'record/end',
    diagnosis_record_cancel: diagnosisUrl + 'record/cancel',
    diagnosis_sysconfig: diagnosisUrl + 'sysconfig',
    diagnosis_record_history_page: diagnosisUrl + 'record/history/page',

    // 通用下载文件
    controlUrl_common_file: controlUrl + '/common/file',

    // 工艺库
    processstore_operatelog_bypage: processstoreUrl + 'operatelog/bypage',
    processstore_adminset_all: processstoreUrl + 'adminset/all',
    processstore_adminset_one: processstoreUrl + 'adminset/one',
    processstore_processlib_shareduser: processstoreUrl + 'processlib/shareduser',
    processstore_processlib_shareduser_bypage: processstoreUrl + 'processlib/shareduser/bypage',
    processlib_bypage: processstoreUrl + '/processlib/bypage',
    processlib_off: processstoreUrl + '/processlib/off',
    processlib_on: processstoreUrl + '/processlib/on',
    processlib_one: processstoreUrl + '/processlib/one',
    processlib_list: processstoreUrl + '/processlib/list',

    // 工艺库文件
    processfile_one: processstoreUrl + '/processfile/one',
    processfile_import: processstoreUrl + '/processfile/import',
    processfile_list: processstoreUrl + '/processfile/list',
    processfile_upload: processstoreUrl + '/processfile/upload',
    processfile_bypage: processstoreUrl + '/processfile/bypage',
    processfile_addfavor: processstoreUrl + '/processfile/addfavor',
    processfile_removefavor: processstoreUrl + '/processfile/delfavor',
    processfile_favorlist: processstoreUrl + '/processfile/myfavor',

    processfile_appauth: processstoreUrl + '/check/appauth',
    processfile_libauth: processstoreUrl + '/check/libauth',

    // 维保中控台-报修工单
    maintain_repair_all_midctrl: maintainUrl + 'repair/all/midctrl',

    // 维保中控台-维保概览
    statistics_memberandrepair: maintainctrlUrl + '/statistic/memberandrepair',
    statistics_customerandrepair: maintainctrlUrl + '/statistic/customerandrepair',
    statistics_dailyhistory: statistics_url + 'dailyhistory',

    // 编辑产品档案
    productarchive: maintainctrlUrl + '/productarchive',
    productarchive_one: maintainctrlUrl + '/productarchive/one',
    productarchive_logs: maintainctrlUrl + '/productarchive/optlogs/bypage',
    productarchive_group: maintainctrlUrl + '/productarchive/customergroup',
    productarchive_devices: maintainctrlUrl + '/productarchive/devices',
    productarchive_devices_nopa: maintainctrlUrl + '/productarchive/devices/nopa',

    dataanalysis_user_all: dataanalysisUrl + 'user/all',
    dataanalysis_device_all: dataanalysisUrl + 'device/all',
    weixin_alluser: wxUrl + 'alluser',
    // 维保中控台-客户名册
    maintainctrl_customroster_customparams: maintainctrlUrl + '/customroster/customparams',
    maintainctrl_customrecord: maintainctrlUrl + '/customrecord',
    maintainctrl_customrecord_bypage: maintainctrlUrl + '/customrecord/bypage',
    maintainctrl_customroster_list: maintainctrlUrl + '/customroster/customerlist',
    maintainctrl_customrecord_one: maintainctrlUrl + '/customrecord/one',
    maintainctrl_customroster_optlogs: maintainctrlUrl + '/customroster/optlogs',
    maintainctrl_customroster_customparam: maintainctrlUrl + '/customroster/customparam',
    maintainctrl_customrecord_getsearchlog: maintainctrlUrl + '/customrecord/getsearchlog',
    // 维保团队
    maintainctrl_markrecord: maintainctrlUrl + '/markrecord',
    maintainctrl_markrecord_bypage: maintainctrlUrl + '/markrecord/bypage',
    enterprise_maintainmember_list: maintainctrlUrl + '/maintainmember/list',

    // 企业成员--修改为maintainctrlUrl
    enterprise_owner_change: maintainctrlUrl + '/base/changeowner',
    enterprise_member_myents: maintainctrlUrl + '/maintainmember/myents',
    enterprise_member_list: maintainctrlUrl + '/maintainmember/list',
    enterprise_member_page: maintainctrlUrl + '/maintainmember/bypage',
    enterprise_member_one: maintainctrlUrl + '/maintainmember/one',
    enterprise_markinfo: maintainctrlUrl + '/maintainmember/markinfo',

    // 维保中控统计
    maintainctrl_statistics: statistics_url + 'devicestatistics',

    // weplus登录
    login_byaccount: wxUrl + 'login/account', // 账号登录
    login_byphone: wxUrl + 'login/phone', // 账号登录
    login_check: wxUrl + 'checklogin',
    logout_wx: wxUrl + 'logout',
    // 维保故障报修
    maintainctrl_getrepair_bystaff: maintainctrlUrl + '/faultrepair', // 报修查询-员工界面
    maintainctrl_getrepair_byuser: maintainctrlUrl + '/faultrepair/user', // 报修查询-当前用户
    maintainctrl_addrepair: maintainctrlUrl + '/faultrepair', // 新建报修
    maintainctrl_getonerepair: maintainctrlUrl + '/faultrepair/one', // 获取单个故障报修详情
    maintainctrl_editonerepair: maintainctrlUrl + '/faultrepair/one', // 编辑单个故障报修详情
    maintainctrl_getrepairreview: maintainctrlUrl + '/faultrepair/evaluation', // 查看报修评价
    maintainctrl_repairdispatch: maintainctrlUrl + '/faultrepair/dispatch', // 故障报修派工
    maintainctrl_repairaccept: maintainctrlUrl + '/faultrepair/receive', // 故障报修接单
    maintainctrl_repairtransfer: maintainctrlUrl + '/faultrepair/transfer', // 故障报修转派
    maintainctrl_repairrecord: maintainctrlUrl + '/faultrepair/servicerecord', // 故障报修服务记录
    maintainctrl_refrehrecord: maintainctrlUrl + '/faultrepair/servicerecord', // 更新故障报修服务记录
    maintainctrl_repairtype: maintainctrlUrl + '/repairtypelist', // 获取报修类型列表
    maintainctrl_repairtypeoptions: maintainctrlUrl + '/repairtypeoption', // 获取报修类型列表 new
    maintainctrl_manucode: maintainctrlUrl + '/productarchive/manucode', // 获取所有设备出厂编号(搜索)
    maintainctrl_solutionmode: maintainctrlUrl + '/solutionlist', // 获取解决方式列表
    maintainctrl_solutionmodeoptions: maintainctrlUrl + '/solutionoption', // 获取解决方式列表 new
    maintainctrl_servicemode: maintainctrlUrl + '/servicemodelist', // 获取服务方式列表
    maintainctrl_servicemodeoptions: maintainctrlUrl + '/servicemodeoption', // 获取服务方式列表 new
    maintainctrl_handlerepair: maintainctrlUrl + '/faultrepair/handle', // 处理故障报修
    maintainctrl_manucodequery: maintainctrlUrl + '/faultrepair/manufacturecode', // 根据出厂编号查询报修
    maintainctrl_phonequery: maintainctrlUrl + '/faultrepair/phone', // 根据手机号查询报修
    maintainctrl_postrepairreview: maintainctrlUrl + '/faultrepair/evaluation', // 发表评论
    maintainctrl_getvercode: maintainctrlUrl + '/vercode', // 报修查询获取验证码
    maintainctrl_getarchivebymanucode: maintainctrlUrl + '/productarchive/manucode/one', // 通过出厂编号查询单个设备档案
    maintainctrl_getdevicebyuuid: maintainctrlUrl + '/productarchive/onebyuuid', // 根据uuid获取设备详情
    maintainctrl_getrepairtime: maintainctrlUrl + '/faultrepair/timestatistics', // 获取工单处理时间
    // 维保客户相关操作
    maintainctrl_getrepair_bycustomer: maintainctrlUrl + '/faultrepair/user', // 报修查询-用户界面
    manufacture_code_detail: maintainctrlUrl + '/productmanual/manufacturingcode', // 报修详情

    // 新维保地图
    statistic_customerandrepair: maintainctrlUrl + '/statistic/customerandrepair',
    statistic_memberandrepair: maintainctrlUrl + '/statistic/memberandrepair',

    statistic_map: maintainctrlUrl + '/statistic/map',
    statistic_customerandrepair_statistic: maintainctrlUrl + '/statistic/customerandrepairstatic',
    statistic_customerrepair: maintainctrlUrl + '/statistic/customerrepair',
    statistic_repairmember: maintainctrlUrl + '/statistic/repairmember',
    statistic_repairmemberdetail: maintainctrlUrl + '/statistic/repairmemberdetail',
    statistic_personal_performance: maintainctrlUrl + '/faultrepair/performance/self',
    statistic_personal_repair: maintainctrlUrl + '/faultrepair/personalstatistics',

    // 产品手册
    maintainctrl_tags: maintainctrlUrl + '/tags',
    product_manual_search: maintainctrlUrl + '/productmanual/search',
    product_manual_detail: maintainctrlUrl + '/productmanual/detail',
    product_manual_config: maintainctrlUrl + '/productmanual/display',
    product_manual_overview: maintainctrlUrl + '/productmanual/overview',
    product_manual_uuid: maintainctrlUrl + '/productmanual/uuid',
    product_manual_bypaid: maintainctrlUrl + '/productmanual/bypaid',
    // 获取设备档案远程码
    remotecode_one: maintainctrlUrl + '/remotecode/one',
    // 查看我的设备/所有设备
    productarchive_byaddress_detail: maintainctrlUrl + '/productarchive/byaddress/detail',
    // 获取全部客户列表
    productarchive_byaddress: maintainctrlUrl + '/productarchive/byaddress',
    // 获取地区
    productarchive_address: maintainctrlUrl + '/productarchive/address',
    // 邀请评价
    invite_evaluate: maintainctrlUrl + '/faultrepair/performance/evaluatelink',
    // 不分页获取全部设备
    productarchive_byparam: maintainctrlUrl + '/productarchive/byparam',

    // 获取操作记录
    maintaincheckorder_getlog: maintainctrlUrl + '/maintainworkorder/getopertaelog',
    // 维检工单详情
    maintaincheckorder_detail: maintainctrlUrl + '/maintainworkorder/getone',
    // 获取工单点检内容(自定义参数)
    get_point_inspection_contents_params: maintainctrlUrl + '/maintainworkorder/config/getpointinspectioncontents',
    // 获取工单点检结果(自定义参数)
    get_point_inspection_result_params: maintainctrlUrl + '/maintainworkorder/config/getpointinspectionresult',
    // 获取设备点检记录
    get_devicecheck_record: maintainctrlUrl + '/maintainworkorder/getrecord',
    // 填写设备点检记录
    post_devicecheck_updaterecord: maintainctrlUrl + '/maintainworkorder/updaterecord',
    // 完成维检工单
    maintainworkorder_finish: maintainctrlUrl + '/maintainworkorder/finish',
    // 验收维检工单
    maintainworkorder_accepting: maintainctrlUrl + '/maintainworkorder/accepting'
};

function getUser () {
    const user = {
        username: Cookies.get('username'),
        openid: Cookies.get('openid'),
        token: Cookies.get('NCCLOUD_TOKEN'),
        vercode: Cookies.get('vercode'),
        lang: Cookies.get('locale') || 'cn',
        timezone: Cookies.get('timezone') || 'Asia/Shanghai'
    };
    return user;
}

function getQueryString (url, Obj) {
    const queryString = Obj === undefined ? url : url + '?';
    const queryArray = [];
    for (const key in Obj) {
        queryArray.push(`${key}=${encodeURIComponent(Obj[key])}`);
    }
    return queryString + queryArray.join('&');
}

export const uploadUrl = '';

export const jssdksignature = (param) => {
    // alert('实际传入的param', param);
    const signature = {
        url: param.isios ? origin_ios_wx_url : location.href.split('#')[0]
    };
    return postT(`${Interface.jssdksignature}`, signature);
};

export const fomatData = param => {
    const user = getUser();
    return get(`${Interface.fomatData}?token=${user.token}`);
};

export const userLogin = param => {
    return post(`${baseUrl}web/login`, param);
};
export const userSignUp = param => {
    return post(`${Interface.registerAjax}`, param);
};
export const vercode = param => {
    return get(`${wxUrl}vercode/${param.phone}?=${param.num}`);
};
// 消息报警
export const htrMsg = (param) => {
    const user = getUser();
    const page = param === undefined ? '' : param.page;
    const page_n = param === undefined ? '' : param.page_n;
    return get(`${baseUrl2}device/focusmachine/fivealarm?username=${user.username}&token=${user.token}&page=${page}&page_n=${page_n}`);
};
// 去获取关注设备，并以磁铁形式展示

export const getFocusMachine = (param) => {
    const user = getUser();
    const page = param === undefined ? '' : param.page;
    const page_n = param === undefined ? '' : param.page_n;
    return get(`${Interface.getFocusMachines}?username=${user.username}&openid=${user.openid}&token=${user.token}&page=${page}&page_n=${page_n}`);
};
export const setMachineAlais = (param) => {
    const user = getUser();
    return put(`${Interface.setalias}?token=${user.token}`, {
        username: user.username,
        ...param
    });
};
export const machineParameterList = param => {
    const user = getUser();
    return get(`${Interface.getHomeParameters}?username=${user.username}&uuid=${param.uuid}&token=${user.token}`);
};

export const allMachineDropList = () => {
    const user = getUser();
    return get(`${Interface.allMachines}?username=${user.username}&openid=${user.openid}&token=${user.token}`);
};

export const yesterdayEfficiency = param => {
    const user = getUser();
    const times = new Date(new Date().getTime() + 8 * 3600 * 1000 - 24 * 3600 * 1000).toISOString().substr(0, 10);
    return get(`${Interface.efficiency}?uuid=${param.uuid}&timestamp=${times}&token=${user.token}`);
};

export const addMachineParameters = param => {
    const user = getUser();
    return get(`${Interface.getDetailMachineParemeter}?uuid=${param.uuid}&username=${user.username}&token=${user.token}`);
};

export const creatSaveMachineParameter = param => {
    const user = getUser();
    const obj = {
        uuid: param.uuid,
        username: user.username,
        params: param.val
    };
    return put(`${Interface.saveDetailMachineParemeter}?token=${user.token}`, obj);
};

export const rmParameter = param => {
    const user = getUser();
    const obj = {
        uuid: param.uuid,
        username: user.username,
        param: param.val
    };
    return del(`${Interface.rmParameters}?token=${user.token}`, obj);
};

export const getAllMachine = (param) => {
    const user = getUser();
    const page = param === undefined ? '' : param.page;
    const page_n = param === undefined ? '' : param.page_n;
    return get(`${Interface.allMachines}?openid=${user.openid}&username=${user.username}&token=${user.token}&page=${page}&page_n=${page_n}`);
};

export const addMachine = (param) => {
    const user = getUser();
    return get(`${Interface.homeLists}?username=${user.username}&openid=${user.openid}&uuid=${param}&token=${user.token}`);
};

export const saveHomeParameter = param => {
    const user = getUser();
    return put(`${Interface.saveHomeParameters}?username=${user.username}&openid=${user.openid}&uuid=${param.uuid}&item=${param.item}&token=${user.token}`);
};

export const removeMachine = param => {
    const user = getUser();
    return del(`${Interface.removeMachines}?openid=${user.openid}&username=${user.username}&uuid=${param.uuid}&token=${user.token}`);
};

export const addMachines = param => {
    const user = getUser();
    param.username = user.username;
    param.openid = user.openid;
    return post(`${Interface.addMachines}?token=${user.token}`, param);
};

export const userData = (param) => {
    const user = getUser();
    const username = (param && param.username) || user.username;
    return get(`${Interface.userData}?username=${username}&openid=${user.openid}&token=${user.token}`);
};

export const modifyUserData = param => {
    const user = getUser();
    param.username = user.username;
    param.openid = user.openid;
    return put(`${Interface.modifyUserData}?token=${user.token}`, param);
};

export const vercodeAjax = param => {
    return get(`${Interface.vercodeAjax}/${param.phone}?language=${param.lang}`);
};
export const registerVercodeAjax = param => {
    return get(`${Interface.registerVercode}/${param.phone}?language=${param.lang}&email=${param.email || ''}`);
};
export const modifyPwd = param => {
    const user = getUser();
    return put(`${Interface.modifyPwd}?token=${user.token}`, param);
};

export const focusMachines = param => {
    const user = getUser();
    param.username = user.username;
    param.openid = user.openid;
    return put(`${Interface.focusMachines}?token=${user.token}`, param);
};

export const getHistoryMsg = () => {
    const user = getUser();
    return get(`${Interface.getHistoryMsgs}?username=${user.username}&token=${user.token}`);
};

export const getFocusMachines = (param) => {
    const user = getUser();
    const page = param === undefined ? '' : param.page;
    const page_n = param === undefined ? '' : param.page_n;
    return get(`${Interface.getFocusMachines}?username=${user.username}&openid=${user.openid}&token=${user.token}&page=${page}&page_n=${page_n}`);
};

export const getIntelligentAlarm = param => {
    const user = getUser();
    return get(`${Interface.getIntelligentAlarm}?username=${user.username}&type=${param.type}&uuid=${param.uuid}&token=${user.token}`);
};

export const setIntelligentAlarm = param => {
    const user = getUser();
    const obj = {
        uuid: param.uuid,
        username: user.username,
        type: param.type,
        values: param.values
    };
    return post(`${Interface.saveIntelligentAlarm}?token=${user.token}`, obj);
};

export const getNewTempMachime = param => {
    const user = getUser();
    return get(`${Interface.getNewTempMachime}?username=${user.username}&token=${user.token}&displayname=${param.displayname}`);
};

export const newTempAddMachineOrRmMachine = param => {
    const user = getUser();
    param.username = user.username;
    console.log(param);
    return post(`${Interface.newTempAddMachineOrRmMachine}?token=${user.token}`, param);
};

export const homeLists = param => {
    const user = getUser();
    return get(`${Interface.homeLists}?username=${user.username}&openid=${user.openid}&uuid=${param.uuid}&token=${user.token}`);
};

export const delTempAddMachineOrRmMachine = param => {
    const user = getUser();
    param.username = user.username;
    return del(`${Interface.newTempAddMachineOrRmMachine}?token=${user.token}`, param);
};

export const getTempName = () => {
    const user = getUser();
    return get(`${Interface.getTempName}?username=${user.username}&token=${user.token}`);
};

export const saveTempName = param => {
    const user = getUser();
    param.username = user.username;
    return post(`${Interface.saveTempName}?token=${user.token}`, param);
};

export const deleteTemp = param => {
    const user = getUser();
    param.username = user.username;
    return del(`${Interface.deleteTemp}?token=${user.token}`, param);
};

export const forgetPwd = param => {
    return put(Interface.forgotPwd, param);
};

export const getNumber = param => {
    const user = getUser();
    return get(`${textUrl}file/number?username=${user.username}`);
};

export const saveFile = param => {
    return post(textUrl + 'file', param);
};

export const getAllFiles = param => {
    return get(`${textUrl}file/allfiles?page=${param.page}`);
};

export const getmycollect = param => {
    return get(`${textUrl}collection?username=${param.username}`);
};

export const deletefile = param => {
    return del(textUrl + 'collection', param);
};

export const addmycollect = param => {
    return post(textUrl + 'collection', param);
};
// 批量删除
export const delfile = param => {
    return del(textUrl + 'file', param);
};

export const changeStatus = param => {
    return put(textUrl + 'file', param);
};

export const changeFile = param => {
    return post(textUrl + 'file/find_file', param);
};

export const editFile = param => {
    return post(textUrl + 'file/editfile', param);
};

export const uploadfile = (param, config) => {
    return post(textUrl + 'file/upload_file', param, config);
};

export const editorFile = param => {
    return post(textUrl + 'file/editor_file', param);
};

export const searchFile = param => {
    return get(`${textUrl}file/search_file?str=${param.str}&type=${param.type}&page=${param.page}`);
};

export const getStatus = param => {
    return get(`${textUrl}file/getStatus?ID=${param.ID}`);
};

export const changeonline = param => {
    return put(textUrl + 'file/change_status', param);
};

export const auditfile = param => {
    return post(textUrl + 'file/submit', param);
};

export const fileInfo = param => {
    return get(`${textUrl}file/fileinfo?ID=${param.ID}`);
};

export const checksharecode = param => {
    return get(`${textUrl}file/search_by_sharecode?sharecode=${param.sharecode}`);
};

export const mypublish = param => {
    return post(textUrl + 'file/mypublish', param);
};

export const publishFile = param => {
    return post(textUrl + 'file/publish_file', param);
};

export const delAnnex = param => {
    return del(textUrl + 'file/del_annex', param);
};

export const findbyid = param => {
    return get(textUrl + 'file/find_by_id?ID=' + param.ID);
};

export const produce_code = param => {
    return post(textUrl + 'code', param);
};

export const getcode = param => {
    return get(textUrl + 'code');
};

export const modify_focus = param => {
    const user = getUser();
    return put(`${textUrl}collection/modify?username=${user.username}&ID=${param.ID}`);
};

export const getauth = param => {
    const user = getUser();
    return get(`${textUrl}auth?username=${user.username}`);
};

export const sortcollect = param => {
    const user = getUser();
    return get(`${textUrl}collection/sort?username=${user.username}&type=${param.type}`);
};

export const getLogsById = param => {
    return get(`${textUrl}audit/get_file_by_id?ID=${param.ID}`);
};

export const getUserInfos = param => {
    const user = getUser();
    return get(`${textUrl}file/get_user_infos?username=${user.username}`);
};

export const applyUser = param => {
    const user = getUser();
    const obj = {
        username: user.username,
        token: user.token
    };
    return post(backUrl + 'doc', obj);
};

// 生产统计
export const getStatisticsData = param => {
    const user = getUser();
    return getT(`${statistics_url}getchartdata?username=${user.username}&uuid=${param.uuid}&chartType=${param.chartType}&xaxis=${param.xaxis}&timename=${encodeURIComponent(param.timename)}&starttime=${param.starttime}&endtime=${param.endtime}`);
};

export const getOrderData = param => {
    const user = getUser();
    return getT(`${statistics_url}getorderdata?username=${user.username}&uuid=${param.uuid}&timeType=${param.timeType}&time=${param.time}`);
};

export const getWorkSection = param => {
    const user = getUser();
    let username = user.username;
    if (param.is_demo) {
        username = '';
    };
    return getT(`${statistics_url}getworksection?username=${username}&password=${statistic_pwd}`);
};

export const delWorkSection = param => {
    const user = getUser();
    return postT(statistics_url + 'delworksection', {
        username: user.username,
        password: statistic_pwd,
        timename: param.timename
    });
};

export const modifyWorkTime = param => {
    const user = getUser();
    return postT(statistics_url + 'modifyworktime', {
        username: user.username,
        password: statistic_pwd,
        workSections: param.workSections
    });
};

export const modifyWeekRange = param => {
    const user = getUser();
    return postT(statistics_url + 'modifyweekrange', {
        username: user.username,
        password: statistic_pwd,
        weekstart: param.weekstart,
        weekend: param.weekend
    });
};

// export const getStatisticsRecord = param => {
//     let user = getUser();
//     return getT(`${statistics_url}getrecord?username=${user.username}&type=${param.type}`)
// }

// export const starttrial = param => {
//     let user = getUser();
//     return getT(`${statistics_url}starttrial?username=${user.username}&type=${param.type}&trialdays=${param.trialdays}`)
// }

export const renewstatistics = param => {
    const user = getUser();
    return post(backUrl + 'analysis', {
        username: user.username,
        type: param.type,
        status: param.status,
        token: user.token
    });
};

// 设备商统计
export const getcustomerrecord = param => {
    const user = getUser();
    return getT(`${statistics_url}getcustomerrecord?username=${user.username}`);
};

// export const supplierdistinct = param => {
//     return postT(statistics_url + "supplierdistinct", param)
// }

export const supplierdatadistinct = param => {
    return postT(statistics_url + 'supplierdatadistinct', param);
};

// export const supplierstatistic = param => {
//     return postT(statistics_url + "supplierstatistic", param)
//     // param["groupby"] =['region'];
//     // return post(statistics_url+"supplierdataaggr",param)
// }

export const supplierdataaggr = param => {
    return postT(statistics_url + 'supplierdataaggr', param);
};

export const supplierworlddata = param => {
    return postT(statistics_url + 'supplierworlddata', param);
};

// export const supplierdata = param => {
//     return postT(statistics_url + "supplierdata", param)
// }

// 故障统计
export const conditiontypecount = param => {
    const user = getUser();
    param.username = user.username;
    const url = getQueryString(statistics_url + 'conditiontypecount', param);
    return getT(url);
};

export const conditiontop = param => {
    const user = getUser();
    param.username = user.username;
    const url = getQueryString(statistics_url + 'conditiontop', param);
    return getT(url);
};

export const conditiontrend = param => {
    const user = getUser();
    param.username = user.username;
    const url = getQueryString(statistics_url + 'conditiontrend', param);
    return getT(url);
};

// 地理分布
export const geodistribution = param => {
    const user = getUser();
    param.username = user.username;
    const url = getQueryString(statistics_url + 'geo/distribution', param);
    return getT(url);
};

export const geolocation = param => {
    const url = getQueryString(statistics_url + 'geo/single', param);
    return getT(url);
};

/// ///////
export const getcontent = param => {
    return get(`${textUrl}file/geturl?url=${param.url}`);
};
export const setScroll = param => {
    const user = getUser();
    return post(`${Interface.scrollSet}?token=${user.token}`, {
        username: user.username,
        ...param
    });
};
export const getScroll = () => {
    const user = getUser();
    return get(`${Interface.scrollSet}?token=${user.token}&username=${user.username}`);
};
export const getScrollList = () => {
    const user = getUser();
    return get(`${Interface.scrollList}?token=${user.token}&username=${user.username}`);
};
export const setTimezone = (param) => {
    const user = getUser();
    return postT(`${Interface.settimezone}`, {
        username: user.username,
        timezone: param,
        password: statistic_pwd
    });
};
export const modifyPhone = (param) => {
    return put(`${Interface.modify_phone}`, param);
};

export const setPdc = (param) => {
    const user = getUser();
    return post(`${pdcapiUrl}?token=${user.token}`, {
        ...param,
        openid: user.openid
    });
};

/** @desc 获取注意智能报警信息 */
export const getPdc = (param) => {
    const user = getUser();
    return get(`${pdcapiUrl}?username=${param.username}&uuid=${param.uuid}&type=${param.type}&token=${user.token}`);
};

/** @desc 获取易损件的报警设置信息 */
export const getRateLife = (param) => {
    const user = getUser();
    return get(`${Interface.ratelife}?username=${param.username}&uuid=${param.uuid}&type=${param.type}&token=${user.token}`);
};
/**
 * @desc 设置易损件的报警设置信息
 * @param {*} param
 */
export const setRateLife = (param) => {
    const user = getUser();

    return post(`${Interface.ratelife}?token=${user.token}`, {
        ...param
    });
};
/**
 * @desc 获取维修保养全部数据
 * @param {*} param
 */
export const getWearData = (param) => {
    const user = getUser();

    return get(`${Interface.weardata}?username=${param.username}&token=${user.token}`);
};
export const getPerWearData = (param) => {
    const user = getUser();

    return get(`${Interface.perweardata}?uuid=${param.uuid}&username=${param.username}&token=${user.token}`);
};

export const getOldAlarmData = (param) => {
    const user = getUser();
    return get(`${Interface.oldintelalarmdata}?uuid=${param.uuid}&username=${user.username}&token=${user.token}&param=${param.param}&skip=${param.skip}&page_n=${param.page_n}`);
};

export const getOldInfoAlarmData = (param) => {
    const querydata = {
        uuid: param.uuid,
        skip: param.skip,
        page_n: param.page_n
    };
    return getT(getQueryString(Interface.oldinfoalarmdata, querydata));
};

export const setAcceptAlarm = (param) => {

};

export const postHelpOffer = (param) => {
    const url = Interface.onlineHelpOffer;
    return post(url, param);
};
export const submitHelpOffer = (param) => {
    const user = getUser();
    const url = Interface.onlinehelp;
    return post(url, { ...param, loginuser: user.loginuser });
};
export const getAlarmEnable = (param) => {
    const user = getUser();
    const querydata = {
        token: user.token,
        username: user.username
    };
    const queryurl = getQueryString(Interface.alarmenable, querydata);
    return get(queryurl);
};

export const setAlarmEnable = (param) => {
    const user = getUser();
    const querydata = {
        token: user.token
    };
    const queryurl = getQueryString(Interface.alarmenable, querydata);
    const putdata = {
        username: user.username,
        enable: param.enable
    };
    return put(queryurl, putdata);
};

/** 新建刀具 */
export const newTool = function (param) {
    const user = getUser();
    const url = getQueryString(Interface.tool, {
        token: user.token
    });
    return post(url, {
        ...param,
        username: user.username
    });
};

/** 停用刀具 */
export const disableTool = function (param) {
    const user = getUser();
    const url = getQueryString(Interface.disabletool, {
        token: user.token
    });
    return post(url, param);
};

/** 报废刀具 */
export const disposeTool = function (param) {
    const user = getUser();
    const url = getQueryString(Interface.disposetool, {
        token: user.token
    });
    return post(url, param);
};

/** 启用刀具 */
export const enableTool = function (param) {
    const user = getUser();
    const url = getQueryString(Interface.enabletool, {
        token: user.token
    });
    return post(url, param);
};

/** 查看刀具 */
export const viewTool = function (param) {
    const user = getUser();
    const queryurl = getQueryString(Interface.viewtool, {
        token: user.token,
        ...param
    });
    return get(queryurl);
};

/** 搜索刀具 */
export const searchTools = function (param) {
    const user = getUser();
    const url = getQueryString(Interface.tool, {
        token: user.token,
        username: user.username,
        ...param
    });
    return get(url);
};

/** 获取刀具号 */
export const getToolCode = function () {
    return get(Interface.toolcode);
};

/** 获取刀具使用历史 */
export const getToolLog = function (param) {
    const user = getUser();
    const queryurl = getQueryString(Interface.toollog, {
        token: user.token,
        username: user.username,
        ...param
    });
    return get(queryurl);
};

/** 新建租赁服务 */
export const newLease = function (param) {
    const user = getUser();
    const queryurl = getQueryString(Interface.leasegroup, {
        token: user.token
    });
    return post(queryurl, {
        username: user.username,
        openid: user.openid || '',
        ...param
    });
};

/** 获取新建租赁服务id */
export const getnewLeaseId = function (param) {
    const user = getUser();
    const queryurl = getQueryString(Interface.getleaseid, {
        token: user.token,
        username: user.username
    });
    return get(queryurl);
};
/** 获取租赁服务列表 */
export const getLeaseList = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.leasegroup, {
        username: user.username,
        shelvestatus: param.shelvestatus || 'all',
        key: param.key,
        page: param.page,
        num: param.num,
        token: user.token
    });

    return get(queryUrl);
};
/** 删除租赁服务 */
export const deleteLease = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.leasegroup, {
        token: user.token
    });
    return del(queryUrl, {
        username: user.username,
        serviceid: param.serviceid
    });
};

/** 获取设备在线状态 */
export const getDeviceOnlineStatus = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.deviceonline, {
        token: user.token
    });
    return post(queryUrl, {
        uuid: param.uuids || []
    });
};

/** 上线服务 */
export const setLeaseOn = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.leaseserviceon, {
        username: user.username,
        token: user.token,
        ...param
    });
    return get(queryUrl);
};
/** 下线服务 */
export const setLeaseOff = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.leaseserviceoff, {
        username: user.username,
        token: user.token,
        ...param
    });
    return get(queryUrl);
};

export const addLeaseDevice = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.leasedevice, {
        token: user.token
    });
    return post(queryUrl, {
        username: user.username,
        ...param
    });
};
export const delLeaseDevice = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.leasedevice, {
        token: user.token
    });
    return del(queryUrl, {
        username: user.username,
        serviceid: param.serviceid,
        uuid: param.uuid
    });
};

export const hireOnLeaseDevice = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.lease_device_onhire, {
        token: user.token,
        username: user.username,
        ...param
    });
    return get(queryUrl);
};

export const hireOffLeaseDevice = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.lease_device_offhire, {
        token: user.token,
        username: user.username,
        ...param
    });
    return get(queryUrl);
};
export const getLeaseDeviceList = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.leasedevice, {
        token: user.token,
        username: user.username,
        ...param
    });
    return get(queryUrl);
};
export const getLeaseServiceDetail = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.leaseserviceone, {
        token: user.token,
        username: user.username,
        ...param
    });
    return get(queryUrl);
};
export const getRentId = function () {
    const user = getUser();
    const queryUrl = getQueryString(Interface.rentid, {
        token: user.token,
        username: user.username
    });
    return get(queryUrl);
};
export const addRent = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.rent, {
        token: user.token
    });
    const data = {
        ...param,
        leaseid: param.leaseid,
        serviceid: param.serviceid,
        servicename: param.servicename,
        startdate: param.startdate,
        deaddate: param.deaddate,
        leaseholder: param.leaseholder,
        valuemode: param.valuemode,
        sellprice: param.sellprice,
        totalprice: param.totalprice,
        amount: param.amount,
        exestatus: param.exestatus,
        paystatus: param.paystatus,
        remark: param.remark
    };
    return post(queryUrl, {
        username: user.username,
        language: user.lang,
        ...data
    });
};
export const startRent = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.startrent, {
        token: user.token
    });
    return post(queryUrl, {
        username: user.username,
        language: user.lang,
        ...param
    });
};
export const cancelRent = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.cancelrent, {
        token: user.token
    });
    return post(queryUrl, {
        username: user.username,
        language: user.lang,
        ...param
    });
};
export const getRentList = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.rent, {
        username: user.username,
        token: user.token,
        ...param
    });
    return get(queryUrl);
};
export const getOneRentDetail = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.onerent, {
        username: user.username,
        token: user.token,
        ...param
    });
    return get(queryUrl);
};
export const getEffectLeaseServices = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.effect_list_service, {
        username: user.username,
        token: user.token,
        ...param
    });
    return get(queryUrl);
};

export const getTotalPrice = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.getallprice, {
        token: user.token
    });
    return post(queryUrl, {
        username: user.username,
        ...param
    });
};
export const updateRent = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.rent, {
        token: user.token
    });
    return put(queryUrl, {
        username: user.username,
        ...param
    });
};
export const getLeaseDeviceNum = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.getleasedevicenum, {
        token: user.token,
        username: user.username
    });
    return get(queryUrl);
};
export const getAllLeaseDeviceUuids = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.all_lease_uuid, {
        token: user.token,
        username: user.username
    });
    return get(queryUrl);
};
/** 获取是否有租赁服务权限 */
export const getLeaseServiceShow = function (param) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.lease_service_auth, {
        token: user.token
    });
    return post(queryUrl, {
        username: user.username
    });
};
/** 获取压缩二维码 */
export const getQrCodeZip = function () {
    const user = getUser();
    const queryUrl = getQueryString(Interface.qrcode_zipurl, {
        token: user.token,
        username: user.username
    });
    return get(queryUrl);
};
export const getLeaseApi = function () {
    return leaseapi;
};
/** 获取现在在申请的租约数 */
export const getOfferLeaseNum = function () {
    const user = getUser();
    const queryUrl = getQueryString(Interface.get_off_lease_num, {
        token: user.token,
        username: user.username
    });
    return get(queryUrl);
};

export const clearServiceDevices = function (data) {
    const user = getUser();
    const queryUrl = getQueryString(Interface.lease_all_device, {
        token: user.token
    });
    return del(queryUrl, {
        username: user.username,
        ...data
    });
};
/** 工艺文件管理 */

// 获取文件分组信息

export const getUploadUrl = () => {
    return `${controlUrl}${Interface.file}`;
};
export const getFileGroups = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.filegroups}`, {
        token: user.token,
        username: user.username
    });
    return get(queryUrl);
};

export const getFileGroup = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.filegroup}`, {
        token: user.token,
        username: user.username,
        id: param
    });
    return get(queryUrl);
};
export const delFileGroup = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.filegroup}`, {
        token: user.token,
        username: user.username
    });
    return del(queryUrl, { ...param, username: user.username });
};
export const editFileGroup = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.filegroup}`, {
        token: user.token
    });
    return put(queryUrl, { ...param, username: user.username });
};
export const newFileGroup = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.filegroup}`, {
        token: user.token
    });
    return post(queryUrl, { ...param, username: user.username });
};
export const newFile = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.file}`, {
        token: user.token,
        username: user.username
    });
    return post(queryUrl, param);
};
export const updateFile = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.file}`, {
        token: user.token
    });
    return put(queryUrl, { ...param, username: user.username });
};
export const delFile = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.file}`, {
        token: user.token
    });
    return del(queryUrl, { ...param, username: user.username });
};
export const searchFiles = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.searchfile}`, {
        ...param,
        token: user.token,
        key: param.searchparams,
        num: param.num,
        page: param.page,
        starttime: param.toptime,
        endtime: param.endtime,
        username: user.username
    });
    return get(queryUrl);
};

export const getGroupFiles = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.groupfiles}`, {
        token: user.token,
        username: user.username,
        ...param
    });
    return get(queryUrl);
};
export const getAllFile = param => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.allfile}`, {
        token: user.token,
        username: user.username,
        ...param
    });
    return get(queryUrl);
};
export const getDownLoadUrl = (file) => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.filedownload}`, {
        token: user.token,
        username: user.username,
        ...file
    });
    return get(queryUrl);
};
export const onlinePriview = (data) => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.fileedit}`, {
        token: user.token,
        username: user.username,
        groupid: data.groupid,
        filename: data.filename
    });
    return get(queryUrl);
};
export const onlineEdit = (data) => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.fileedit}`, {
        token: user.token
    });
    data.append('username', user.username);
    return postFormData(queryUrl, data);
};
/** 下发文件 */
export const downFileToDevice = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${controlUrl}${Interface.down_file_to_device}`, {
        token: user.token
    });
    return post(queryUrl, { ...param, username: user.username });
};
export const getAllFriendGroups = () => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.friend_group}`, {
        username: user.username
    });
    return getT(queryUrl);
};
export const newFriendGroup = (param) => {
    const user = getUser();
    return postT(Interface.friend_group, { username: user.username, ...param });
};
export const editFriendGroup = (param) => {
    const user = getUser();
    return putT(Interface.friend_group, { username: user.username, ...param });
};
export const delFriendGroup = (param) => {
    return delT(Interface.friend_group, { ...param });
};
export const getFriendsOfGroup = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.friends_of_group}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};
/** 创建新的好友 */
export const newFriend = (param) => {
    const user = getUser();
    return postT(`${Interface.friend}`, {
        applicant: user.username,
        ...param
    });
};

export const delFriend = (param) => {
    const user = getUser();
    return delT(`${Interface.friend}`, {
        ...param,
        applicant: user.username
    });
};
/** 获取申请我的好友 */
export const getApplyMe = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.friend_apply_me}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};
/** 同意申请 */
export const agreeApply = (param) => {
    const user = getUser();
    return postT(`${Interface.friend_agree}`, { ...param, respondent: user.username });
};
export const getApplyUserData = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.apply_data}`, {
        ...param,
        respondent: user.username
    });
    return getT(queryUrl);
};
export const getFriendData = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.friend_user}`, {
        ...param,
        applicant: user.username
    });
    return getT(queryUrl);
};

export const getUnconfirmFriendData = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.friend_unconfirm_user}`, {
        ...param,
        applicant: user.username
    });
    return getT(queryUrl);
};

export const editFriend = (param) => {
    const user = getUser();
    return putT(`${Interface.friend}`, { ...param, applicant: user.username });
};
/** 新建好友时用此接口查询输入是否为维宏用户 以及其信息 */
export const searchFriend = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.check_friend}`, {
        ...param,
        applicant: user.username
    });
    return getT(queryUrl);
};
/** 搜已存在好友 */
export const findFriend = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.friend}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};
export const copyFriend = (param) => {
    const user = getUser();
    return postT(`${Interface.copy_friend}`, { ...param, respondent: user.username });
};
export const removeFriendFromGroup = (param) => {
    return delT(`${Interface.del_friend_fromgroup}`, { ...param });
};
export const getOtherGroupFriends = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.join_other}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};
/** 拒绝好友 */
export const refuseFriendApply = (param) => {
    const user = getUser();
    return postT(`${Interface.friend_refuse}`, {
        respondent: user.username,
        ...param
    });
};

export const friendUserAlluser = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.friend_user_alluser}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const exprecordNew = (param) => {
    const user = getUser();
    return postT(`${Interface.exprecord_new}`, { ...param, directorName: user.username });
};

export const exprecordModifystatus = (param) => {
    const user = getUser();
    return putT(`${Interface.exprecord_modifystatus}`, { ...param, operator: user.username });
};

export const exprecordFilter = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.exprecord_filter}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const exprecordDetail = (param) => {
    const queryUrl = getQueryString(`${Interface.exprecord_detail}`, {
        ...param
    });
    return getT(queryUrl);
};

export const exprecordLog = (param) => {
    const queryUrl = getQueryString(`${Interface.exprecord_log}`, {
        ...param
    });
    return getT(queryUrl);
};

export const exprecordModifyinfo = (param) => {
    const user = getUser();
    return putT(`${Interface.exprecord_modifyinfo}`, { ...param, operator: user.username });
};

export const exprecordChecktruncated = (param) => {
    const queryUrl = getQueryString(`${Interface.exprecord_checktruncated}`, {
        ...param
    });
    return getT(queryUrl);
};

export const deviceAdd = (param) => {
    const user = getUser();
    return postT(`${Interface.device_add}`, { ...param, operator: user.username });
};

export const deviceDelete = (param) => {
    const user = getUser();
    return delT(`${Interface.device_delete}`, { ...param, operator: user.username });
};

export const memberAdd = (param) => {
    const user = getUser();
    return postT(`${Interface.member_add}`, { ...param, operator: user.username });
};

export const memberDelete = (param) => {
    const user = getUser();
    return delT(`${Interface.member_delete}`, { ...param, operator: user.username });
};

export const timerangeNew = (param) => {
    const user = getUser();
    return postT(`${Interface.timerange_new}`, { ...param, operator: user.username });
};

export const timerangeFilter = (param) => {
    const queryUrl = getQueryString(`${Interface.timerange_filter}`, {
        ...param
    });
    return getT(queryUrl);
};

export const timerangeModifystatus = (param) => {
    const user = getUser();
    return putT(`${Interface.timerange_modifystatus}`, { ...param, operator: user.username });
};

export const timerangeDetail = (param) => {
    const queryUrl = getQueryString(`${Interface.timerange_detail}`, {
        ...param
    });
    return getT(queryUrl);
};

export const timerangeModifycontent = (param) => {
    const user = getUser();
    return putT(`${Interface.timerange_modifycontent}`, { ...param, operator: user.username });
};

export const faultNew = (param) => {
    const user = getUser();
    return postT(`${Interface.fault_new}`, { ...param, operator: user.username });
};

export const faultFilter = (param) => {
    const queryUrl = getQueryString(`${Interface.fault_filter}`, {
        ...param
    });
    return getT(queryUrl);
};

export const faultModifystatus = (param) => {
    const user = getUser();
    return putT(`${Interface.fault_modifystatus}`, { ...param, operator: user.username });
};

export const faultDetail = (param) => {
    const queryUrl = getQueryString(`${Interface.fault_detail}`, {
        ...param
    });
    return getT(queryUrl);
};

export const faultModifycontent = (param) => {
    const user = getUser();
    return putT(`${Interface.fault_modifycontent}`, { ...param, operator: user.username });
};

export const premaintainNew = (param) => {
    const user = getUser();
    return postT(`${Interface.premaintain_new}`, { ...param, operator: user.username });
};

export const premaintainFilter = (param) => {
    const queryUrl = getQueryString(`${Interface.premaintain_filter}`, {
        ...param
    });
    return getT(queryUrl);
};

export const premaintainModifystatus = (param) => {
    const user = getUser();
    return putT(`${Interface.premaintain_modifystatus}`, { ...param, operator: user.username });
};

export const premaintainModifycontent = (param) => {
    const user = getUser();
    return putT(`${Interface.premaintain_modifycontent}`, { ...param, operator: user.username });
};

export const premaintainDetail = (param) => {
    const queryUrl = getQueryString(`${Interface.premaintain_detail}`, {
        ...param
    });
    return getT(queryUrl);
};

export const deviceDetail = (param) => {
    const queryUrl = getQueryString(`${Interface.device_detail}`, {
        ...param
    });
    return getT(queryUrl);
};

export const deviceModifyinfo = (param) => {
    const user = getUser();
    return putT(`${Interface.device_modifyinfo}`, { ...param, operator: user.username });
};

export const reportAll = (param) => {
    const queryUrl = getQueryString(`${Interface.report_all}`, {
        ...param
    });
    return getT(queryUrl);
};

export const reportCreate = (param) => {
    const user = getUser();
    return postT(`${Interface.report_create}`, { ...param, operator: user.username });
};

export const reportDelete = (param) => {
    const user = getUser();
    return delT(`${Interface.report_delete}`, { ...param, operator: user.username });
};

export const reportDownload = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.report_download}`, {
        ...param,
        token: user.token
    });
    return queryUrl;
};

/** 获取预加载参数数据 */
export const preLoadParamValue = (param) => {
    return postT(`${Interface.pre_load_param}`, { ...param });
};
/** 获取单个设备所有数据 */
export const preLoadPerdeviceParamValue = (param) => {
    const queryUrl = getQueryString(`${Interface.pre_one_device_param_value}`, {
        ...param
    });
    return getT(queryUrl);
};

/** 获取文件分享 */
export const shareFileToFriend = (param) => {
    const user = getUser();
    return postT(`${Interface.share_file_to_friend}`, { ...param, username: user.username });
};

/** 设置语言 */
export const setLanguage = (param) => {
    const user = getUser();
    return putT(`${Interface.set_language}`, { ...param, username: user.username });
};

/** 获取二维码qrcodeid */
export const getLoginQrCodeID = (param) => {
    return get(`${Interface.get_login_qrcodeid}`);
};

/** 返回微信链接 */
export const getWechatUrl = () => {
    return wxUrl;
};

// 接口：检查登录二维码是否被扫码确认
export const checkLoginQrcodeStatus = (loginqrcodeid) => {
    return get(`${Interface.check_login_qrcode}?qrcodeid=${loginqrcodeid}`);
};

export const pdcAllapps = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_allapps}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const pdcSelfapp = (param) => {
    const user = getUser();
    return postT(`${Interface.pdc_selfapp}`, { ...param, username: user.username });
};

export const pdcDelSelfapp = (param) => {
    const user = getUser();
    return delT(`${Interface.pdc_selfapp}`, { ...param, username: user.username });
};

export const pdcAllselfapp = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_allselfapp}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const ncapplogoUrl = config.ncapplogoUrl;
export const submenulogoUrl = config.submenulogoUrl;

export const pdcCheckappauth = (param) => {
    const user = getUser();
    return postT(`${Interface.pdc_checkappauth}`, { ...param, username: user.username });
};

export const pdcAllmyapps = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_allmyapps}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const pdcHomepage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_homepage}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const pdcPostHomepage = (param) => {
    const user = getUser();
    return postT(`${Interface.pdc_homepage}`, { ...param, username: user.username });
};

export const pdcCommonusedSet = (param) => {
    const user = getUser();
    return putT(`${Interface.pdc_commonused_set}`, { ...param, username: user.username });
};

export const pdcCommonused = (param) => {
    const user = getUser();
    return postT(`${Interface.pdc_commonused}`, { ...param, username: user.username });
};

export const pdcGetCommonusedSet = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_commonused_set}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const pdcGetCommonused = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_commonused}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const pdcDelCommonused = (param) => {
    const user = getUser();
    return delT(`${Interface.pdc_commonused}`, { ...param, username: user.username });
};

export const pdcAllselfappCommonused = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_allselfapp_commonused}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const pdcAllselfappHomepage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_allselfapp_homepage}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const pdcSubmenusMenuurl = (param) => {
    const queryUrl = getQueryString(`${Interface.pdc_submenus_menuurl}`, {
        ...param
    });
    return getT(queryUrl);
};

export const pdcSubmenuCheck = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_submenu_check}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const pdcSelfappRemotemonitor = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_selfapp_remotemonitor}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const pdcOneselfapp = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_oneselfapp}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const pdcInaccessibleurl = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.pdc_inaccessibleurl}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const getFocusmachineUsers = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.focusmachine_users}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const delFocusmachineUsers = (param) => {
    const user = getUser();
    return delT(`${Interface.focusmachine_users}`, { ...param, adminuser: user.username });
};

export const focusmachineAdmin = (param) => {
    const user = getUser();
    return putT(`${Interface.focusmachine_admin}`, { ...param, account: user.username });
};

export const focusmachineWebAdmin = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.focusmachine_web_admin}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainPlanAll = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_plan_all}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainAddPlan = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_plan}`, { ...param, username: user.username, timezone: user.timezone });
};

export const maintainPutPlan = (param) => {
    const user = getUser();
    return putT(`${Interface.maintain_plan}`, { ...param, username: user.username });
};

export const maintainPlanRecv = (param) => {
    const user = getUser();
    return putT(`${Interface.maintain_plan_recv}`, { ...param, username: user.username });
};

export const maintainPlanShield = (param) => {
    const user = getUser();
    return putT(`${Interface.maintain_plan_shield}`, { ...param, username: user.username });
};

export const maintainDelPlanOne = (param) => {
    const user = getUser();
    return delT(`${Interface.maintain_plan_one}`, { ...param, username: user.username });
};

export const maintainGetPlanOne = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_plan_one}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const capiCommonFile = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.capi_common_file}`, {
        token: user.token,
        username: user.username
    });
    return postFormData(queryUrl, param);
};
export const capiCommonFileUrl = () => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.capi_common_file}`, {
        username: user.username
    });
    return queryUrl;
};
export const capiGetCommonFile = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.capi_common_file}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const capiDelCommonFile = (param) => {
    const user = getUser();
    return delT(`${Interface.capi_common_file}`, { ...param, username: user.username });
};
export const capiDelCommonSomeFile = (param) => {
    const user = getUser();
    return delT(`${Interface.capi_common_some_file}`, { ...param, username: user.username });
};

export const maintainTaskAll = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_task_all}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainAddTask = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_task}`, { ...param, username: user.username, creator: user.username });
};

export const maintainTaskRelay = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_task_relay}`, { ...param, username: user.username });
};

export const maintainTaskCommit = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_task_commit}`, { ...param, username: user.username });
};

export const maintainTaskComplete = (param) => {
    const user = getUser();
    return putT(`${Interface.maintain_task_complete}`, { ...param, username: user.username });
};

export const maintainTaskClose = (param) => {
    const user = getUser();
    return putT(`${Interface.maintain_task_close}`, { ...param, username: user.username });
};

export const maintainTaskReopen = (param) => {
    const user = getUser();
    return putT(`${Interface.maintain_task_reopen}`, { ...param, username: user.username });
};

export const maintainTaskRemark = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_task_remark}`, { ...param, username: user.username });
};

export const maintainTaskOne = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_task_one}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainTaskManagelogs = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_task_managelogs}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainTaskCommitReceivers = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_task_commit_receivers}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainSetting = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_setting}`, { ...param, username: user.username });
};

export const maintainGetSetting = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_setting}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainPlanAttachment = (param) => {
    const user = getUser();
    return delT(`${Interface.maintain_plan_attachment}`, { ...param, username: user.username });
};

export const maintainAddPlanAttachment = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_plan_attachment}`, { ...param, username: user.username });
};

export const deviceledgerAdd = (param) => {
    const user = getUser();
    return postT(`${Interface.deviceledger_add}`, { ...param, username: user.username, openid: user.openid });
};

export const deviceledgerBind = (param) => {
    const user = getUser();
    return putT(`${Interface.deviceledger_bind}`, { ...param, openid: user.openid, username: user.username });
};

export const deviceledgerDelOne = (param) => {
    const user = getUser();
    return delT(`${Interface.deviceledger_one}`, { ...param, openid: user.openid, username: user.username });
};

export const deviceledgerUnbind = (param) => {
    const user = getUser();
    return putT(`${Interface.deviceledger_unbind}`, { ...param, openid: user.openid, username: user.username });
};

export const deviceledgerEdit = (param) => {
    const user = getUser();
    return putT(`${Interface.deviceledger_edit}`, { ...param, username: user.username });
};

export const deviceledgerModifyalias = (param) => {
    const user = getUser();
    return putT(`${Interface.deviceledger_modifyalias}`, { ...param, username: user.username });
};

export const deviceledgerAddlock = (param) => {
    const user = getUser();
    return putT(`${Interface.deviceledger_addlock}`, { ...param, username: user.username });
};

export const deviceledgerRemovelock = (param) => {
    const user = getUser();
    return putT(`${Interface.deviceledger_removelock}`, { ...param, username: user.username });
};

export const deviceledgerModifyuuid = (param) => {
    const user = getUser();
    return putT(`${Interface.deviceledger_modifyuuid}`, { ...param, username: user.username });
};

export const deviceledgerAll = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.deviceledger_all}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const deviceledgerAllbypage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.deviceledger_allbypage}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const deviceledgerFilter = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.deviceledger_filter}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const deviceledgerBase = (param) => {
    const queryUrl = getQueryString(`${Interface.deviceledger_base}`, {
        ...param
    });
    return getT(queryUrl);
};

export const deviceledgerDetail = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.deviceledger_detail}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainRepairAll = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_repair_all}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainAddRepair = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_repair}`, { ...param, username: user.username, creator: user.username });
};

export const maintainGetRepairOne = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_repair_one}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainRepairRelay = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_repair_relay}`, { ...param, username: user.username });
};

export const maintainRepairComplete = (param) => {
    const user = getUser();
    return putT(`${Interface.maintain_repair_complete}`, { ...param, username: user.username });
};

export const maintainRepairClose = (param) => {
    const user = getUser();
    return putT(`${Interface.maintain_repair_close}`, { ...param, username: user.username });
};

export const maintainRepairRemark = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_repair_remark}`, { ...param, username: user.username });
};

export const maintainRepairReopen = (param) => {
    const user = getUser();
    return putT(`${Interface.maintain_repair_reopen}`, { ...param, username: user.username });
};

export const maintainRepairCommit = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_repair_commit}`, { ...param, username: user.username });
};

export const maintainRepairCommitReceivers = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_repair_commit_receivers}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const maintainRepairManagelogs = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_repair_managelogs}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const seafileToken = (param) => {
    const queryUrl = getQueryString(`${Interface.seafile_token}`, {
        ...param
    });
    return getT(queryUrl);
};

export const seafileApi2Repos = (headers, param) => {
    const queryUrl = `${Interface.seafile_api2_repos}` + '?type=' + param.type;
    return getSeafile(queryUrl, headers);
};

export const postSeafileApi2Repos = (headers, param) => {
    return postSeafile(`${Interface.seafile_api2_repos}`, headers, param);
};

export const renameSeafileApi2Repos = (headers, param, urlParam) => {
    const url = `${Interface.seafile_api2_repos}` + urlParam.id + '/?op=rename';
    return postFormDataSeafile(url, headers, param);
};

export const delSeafileApi2Repos = (headers, urlParam) => {
    const url = `${Interface.seafile_api2_repos}` + urlParam.id + '/';
    return delSeafile(url, headers);
};

export const getSeafileApi21ReposDir = (headers, param, urlParam) => {
    const queryUrl = `${Interface.seafile_api21_repos}` + urlParam.id + '/dir/' + '?p=' + param.dir;
    return getSeafile(queryUrl, headers);
};

export const newFolderSeafileApi2ReposDir = (headers, param, urlParam) => {
    const url = `${Interface.seafile_api21_repos}` + urlParam.id + '/dir/' + '?p=' + urlParam.dir;
    return postFormDataSeafile(url, headers, param);
};

export const delSeafileApi2ReposDir = (headers, urlParam) => {
    const url = `${Interface.seafile_api2_repos}` + urlParam.id + '/dir/' + '?p=' + urlParam.dir;
    return delSeafile(url, headers);
};

export const delSeafileApi2ReposFile = (headers, urlParam) => {
    const url = `${Interface.seafile_api2_repos}` + urlParam.id + '/file/' + '?p=' + urlParam.dir;
    return delSeafile(url, headers);
};

export const renameSeafileApi2ReposDir = (headers, param, urlParam) => {
    const url = `${Interface.seafile_api2_repos}` + urlParam.id + '/dir/' + '?p=' + urlParam.dir;
    return postFormDataSeafile(url, headers, param);
};

export const renameSeafileApi2ReposFile = (headers, param, urlParam) => {
    const url = `${Interface.seafile_api21_repos}` + urlParam.id + '/file/' + '?p=' + urlParam.dir;
    return postFormDataSeafile(url, headers, param);
};

export const downloadSeafileApi2ReposDir = (headers, param, urlParam) => {
    const url = `${Interface.seafile_api21_repos}` + urlParam.id + '/zip-task/';
    return postFormDataSeafile(url, headers, param);
};

export const downloadSeafileApi2ReposFile = (headers, urlParam) => {
    const url = `${Interface.seafile_api2_repos}` + urlParam.id + '/file/' + '?p=' + urlParam.dir;
    return getSeafile(url, headers);
};

export const seafileApi21Queryzipprogress = (headers, urlParam) => {
    const queryUrl = getQueryString(`${Interface.seafile_api21_queryzipprogress}`, {
        ...urlParam
    });
    return getSeafile(queryUrl, headers);
};

export const seafileFromprocessfile = (param) => {
    const user = getUser();
    return postT(`${Interface.seafile_fromprocessfile}`, { ...param, username: user.username });
};

export const seafileToprocessfile = (param) => {
    const user = getUser();
    return postT(`${Interface.seafile_toprocessfile}`, { ...param, username: user.username });
};

export const seafileUploadLink = (headers, urlParam) => {
    const url = `${Interface.seafile_api2_repos}` + urlParam.id + '/upload-link/' + '?p=' + urlParam.dir;
    return getSeafile(url, headers);
};

export const seafileUploadFile = (url, headers, param) => {
    return postFormDataSeafile(url, headers, param);
};

export const seafileGetDatabaseDetail = (headers, urlParam) => {
    const url = `${Interface.seafile_api2_repos}` + urlParam.id;
    return getSeafile(url, headers);
};

export const seafileApi21ReposBatchDeleteItem = (headers, param) => {
    const url = `${Interface.seafile_api21_repos_batch_delete_item}`;
    return delSeafile(url, headers, param);
};

export const seafileMoveItem = (headers, param) => {
    const url = `${Interface.seafile_api21_repos}` + 'sync-batch-move-item/';
    return postSeafile(url, headers, param);
};

export const seafileCopyItem = (headers, param) => {
    const url = `${Interface.seafile_api21_repos}` + 'sync-batch-copy-item/';
    return postSeafile(url, headers, param);
};

export const seafileApi2AccountInfo = (headers) => {
    const queryUrl = `${Interface.seafile_api2_account_info}`;
    return getSeafile(queryUrl, headers);
};

export const selfregmachineReguuid = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.selfregmachine_reguuid}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const deviceledgerLogout = (param) => {
    const user = getUser();
    return postT(`${Interface.deviceledger_logout}`, { ...param, username: user.username });
};

export const devicePropertyAll = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.device_property_all}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const postDeviceProperty = (param) => {
    const user = getUser();
    return postT(`${Interface.device_property}`, { ...param, username: user.username });
};

export const delDeviceProperty = (param) => {
    const user = getUser();
    return delT(`${Interface.device_property}`, { ...param, username: user.username });
};

export const deviceTopicAll = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.device_topic_all}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const devicePropertyOne = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.device_property_one}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

// 客户记录
export const shareCustomerList = (param) => {
    const user = getUser();
    return postT(Interface.customer_list_url, { username: user.username, ...param });
};
export const changeCustomerListAlias = (param) => {
    const user = getUser();
    return putT(Interface.customer_list_alias, { username: user.username, ...param });
};
export const delCustomerList = (param) => {
    const user = getUser();
    return delT(Interface.customer_list_url, { username: user.username, ...param });
};

export const newCustomerList = (param) => {
    const user = getUser();
    return postT(Interface.customer_list_url, { username: user.username, ...param });
};
export const editCustomerList = (param) => {
    const user = getUser();
    return putT(Interface.customer_list_url, { username: user.username, ...param });
};

export const getAllCustomerList = () => {
    const user = getUser();
    const queryString = getQueryString(Interface.all_customer_list_url, { username: user.username });
    return getT(queryString);
};
export const getOneCustomerList = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.customer_list_one_url, { username: user.username });
    return getT(queryString);
};
export const changeCustomerListAdmin = (param) => {
    const user = getUser();
    return postT(Interface.change_customer_admin, { username: user.username, ...param });
};

export const addCustomerListShare = (param) => {
    const user = getUser();
    return postT(Interface.customer_sharer, { username: user.username, ...param });
};
export const delCustomerListUser = (param) => {
    const user = getUser();
    return delT(Interface.customer_sharer, { username: user.username, ...param });
};

export const getCustomerOptLog = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.customer_list_opt_log, { username: user.username, ...param });
    return getT(queryString);
};

export const agreeReceiveCustomerListShare = (param) => {
    const user = getUser();
    return postT(Interface.agree_customer_share, { username: user.username, ...param });
};

export const cancelChangeCustomerAdmin = (param) => {
    const user = getUser();
    return postT(Interface.cancel_customer_users, { username: user.username, ...param });
};

export const queryCustomerRecord = (param) => {
    const user = getUser();
    return postT(Interface.customer_record_find_url, { username: user.username, ...param });
};

export const delCustomerRecord = (param) => {
    const user = getUser();
    return delT(Interface.customer_record_url, { username: user.username, ...param });
};

export const delCustomerRecordLogic = (param) => {
    const user = getUser();
    return delT(Interface.customer_record_logic_del, { username: user.username, ...param });
};

export const editCustomerRecord = (param) => {
    const user = getUser();
    return putT(Interface.customer_record_url, { username: user.username, ...param });
};

export const newCustomerRecord = (param) => {
    const user = getUser();
    return postT(Interface.customer_record_url, { username: user.username, ...param });
};

export const recoverCustomerRecord = (param) => {
    const user = getUser();
    return postT(Interface.customer_record_restore, { username: user.username, ...param });
};

export const queryCustomerRecordOne = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.customer_record_one, { username: user.username, ...param });
    return getT(queryString);
};

export const getCustomerListUser = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.customer_list_users, { username: user.username, ...param });
    return getT(queryString);
};

export const exportCustomerListRecord = (param) => {
    const user = getUser();
    return postT(Interface.customer_list_record_export, { username: user.username, ...param });
};

export const importCustomerListRecord = (param) => {
    const user = getUser();
    return { action: Interface.customer_list_record_import, param: { username: user.username, ...param } };
};
export const getCustomerListLabel = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.customer_list_label, { username: user.username, ...param });
    return getT(queryString);
};
export const getCustomerListRecordTemp = (param) => {
    const user = getUser();
    return postT(Interface.customer_list_record_template, { username: user.username, ...param });
};

export const getSystemMessage = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.message_service, { username: user.username, ...param });
    return getT(queryString);
};

export const dealSystemMessage = (param) => {
    const user = getUser();
    return postT(Interface.message_service, { username: user.username, ...param });
};
export const inventorymanageWarehouseAll = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_warehouse_all}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const postInventorymanageWarehouse = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_warehouse}`, { ...param, username: user.username });
};

export const putInventorymanageWarehouse = (param) => {
    const user = getUser();
    return putT(`${Interface.inventorymanage_warehouse}`, { ...param, username: user.username });
};

export const delInventorymanageWarehouseOne = (param) => {
    const user = getUser();
    return delT(`${Interface.inventorymanage_warehouse_one}`, { ...param, username: user.username });
};

export const inventorymanageWarehouseAlias = (param) => {
    const user = getUser();
    return putT(`${Interface.inventorymanage_warehouse_alias}`, { ...param, username: user.username });
};

export const inventorymanageWarehouseShare = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_warehouse_share}`, { ...param, username: user.username });
};

export const inventorymanageWarehouseSharedusersBypage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_warehouse_sharedusers_bypage}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageWarehouseShareduser = (param) => {
    const user = getUser();
    return delT(`${Interface.inventorymanage_warehouse_shareduser}`, { ...param, username: user.username });
};

export const inventorymanageWarehouseAdminuser = (param) => {
    const user = getUser();
    return putT(`${Interface.inventorymanage_warehouse_adminuser}`, { ...param, username: user.username });
};

export const postInventorymanageMaterialOne = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_material_one}`, { ...param, username: user.username });
};

export const inventorymanageMaterialAllBypage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_material_all_bypage}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageMaterialDeactivate = (param) => {
    const user = getUser();
    return putT(`${Interface.inventorymanage_material_deactivate}`, { ...param, username: user.username });
};

export const inventorymanageMaterialActivate = (param) => {
    const user = getUser();
    return putT(`${Interface.inventorymanage_material_activate}`, { ...param, username: user.username });
};

export const delInventorymanageMaterialOne = (param) => {
    const user = getUser();
    return delT(`${Interface.inventorymanage_material_one}`, { ...param, username: user.username });
};

export const postInventorymanageMaterialBomOne = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_material_bom_one}`, { ...param, username: user.username });
};

export const inventorymanageMaterialAllBycodename = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_material_all_bycodename}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageMaterialBomList = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_material_bom_list}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const getInventorymanageMaterialBomOne = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_material_bom_one}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const delInventorymanageMaterialBomOne = (param) => {
    const user = getUser();
    return delT(`${Interface.inventorymanage_material_bom_one}`, { ...param, username: user.username });
};

export const putInventorymanageMaterialBomOne = (param) => {
    const user = getUser();
    return putT(`${Interface.inventorymanage_material_bom_one}`, { ...param, username: user.username });
};

export const inventorymanageFlowDefineList = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_flow_define_list}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageFlowDefineOne = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_flow_define_one}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageMaterialImport = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_material_import}`, { ...param, username: user.username });
};

export const inventorymanageWarehouseAllListAdmin = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_warehouse_all_list_admin}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageWarehouseSharedusersList = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_warehouse_sharedusers_list}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};
export const postInventorymanageFlowDefineHandler = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_flow_define_handler}`, { ...param, username: user.username });
};

export const delInventorymanageFlowDefineHandler = (param) => {
    const user = getUser();
    return delT(`${Interface.inventorymanage_flow_define_handler}`, { ...param, username: user.username });
};

export const inventorymanageFlowManageAll = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_flow_manage_all}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageMaterialBomImport = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_material_bom_import}`, { ...param, username: user.username });
};

export const inventorymanageFlowManageInitiate = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_flow_manage_initiate}`, { ...param, username: user.username });
};

export const inventorymanageFlowManageOne = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_flow_manage_one}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageFlowManageLogs = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_flow_manage_logs}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageFlowNodePrenodes = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_flow_node_prenodes}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageFlowManageRefuse = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_flow_manage_refuse}`, { ...param, username: user.username });
};

export const inventorymanageFlowManageOneSimple = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_flow_manage_one_simple}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageFlowManageApprove = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_flow_manage_approve}`, { ...param, username: user.username });
};

export const inventorymanageFlowManageReinitiate = (param) => {
    const user = getUser();
    return postT(`${Interface.inventorymanage_flow_manage_reinitiate}`, { ...param, username: user.username });
};

export const inventorymanageFlowSponsors = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_flow_sponsors}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageInventoryBitchesBymtcode = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_inventory_bitches_bymtcode}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageInventoryAll = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_inventory_all}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const exitCustomerListShare = (param) => {
    const user = getUser();
    return postT(`${Interface.customer_record_exit}`, { ...param, username: user.username });
};

export const inventorymanageWarehouseAdminuserCancel = (param) => {
    const user = getUser();
    return putT(`${Interface.inventorymanage_warehouse_adminuser_cancel}`, { ...param, username: user.username });
};

export const dealAllMessages = (param) => {
    const user = getUser();
    return postT(Interface.message_all_service, { username: user.username, ...param });
};

export const getInventorymanageWarehouseOne = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.inventorymanage_warehouse_one}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const inventorymanageWarehouseCheckadmin = (param) => {
    const user = getUser();
    return postT(Interface.inventorymanage_warehouse_checkadmin, { username: user.username, ...param });
};

// 购买相关
export const findAppsHaveSpu = (param) => {
    const queryUrl = getQueryString(`${Interface.find_apps_have_spu}`, {
        ...param
    });
    return getT(queryUrl);
};

export const findFunctionsInApp = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.find_functions_in_app}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const findAllSkuParams = (param) => {
    const queryUrl = getQueryString(`${Interface.find_all_sku_params}`, {
        ...param
    });
    return getT(queryUrl);
};

export const findOneSpu = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.find_one_spu}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const findFunctionOpenStatus = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.find_function_open_status}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const checkPurchaseOrder = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.check_purchase_order}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const createPurchaseOrder = (param) => {
    const user = getUser();
    return postT(`${Interface.create_purchase_order}`, { ...param, username: user.username });
};

export const wxprepayPurchaseOrder = (param) => {
    const user = getUser();
    return postT(`${Interface.wxprepay_purchase_order}`, { ...param, username: user.username });
};

export const findOrderDetail = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.find_order_detail}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const payFreeOrder = (param) => {
    const user = getUser();
    return putT(Interface.pay_free_order, { username: user.username, ...param });
};

export const userMaxDeviceCount = () => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.user_max_device_count}`, {
        username: user.username
    });
    return getT(queryUrl);
};

export const userLedgerCount = () => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.user_ledger_count}`, {
        username: user.username
    });
    return getT(queryUrl);
};

export const findDeviceexpanOrder = () => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.find_deviceexpan_order}`, {
        username: user.username
    });
    return getT(queryUrl);
};

export const changeDeviceexpanTime = (param) => {
    const user = getUser();
    return putT(Interface.change_deviceexpan_time, { username: user.username, ...param });
};

export const getCheckDeviceUrls = (param) => {
    const queryUrl = getQueryString(backUrl + 'ncapp/checkdeviceurls', {
        ...param
    });
    return getT(queryUrl);
};

export const findOpenedFunction = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.find_opened_function}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const findOrders = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.find_orders}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const cancelOrder = (param) => {
    const user = getUser();
    return putT(Interface.cancel_order, { username: user.username, ...param });
};

export const getapps = (param) => {
    const queryUrl = getQueryString(backUrl + 'ncapp/filterapps', {
        ...param
    });
    return getT(queryUrl);
};

export const messageCalendar = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.message_calendar, { username: user.username, ...param });
    return getT(queryString);
};

export const messageCalendarTodolist = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.message_calendar_todolist, { username: user.username, ...param });
    return getT(queryString);
};

export const messageCalendarStatus = (param) => {
    const user = getUser();
    return putT(Interface.message_calendar_status, { username: user.username, ...param });
};

export const getDiagnosisRealtimeParamsset = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.diagnosis_realtime_paramsset, { username: user.username, ...param });
    return getT(queryString);
};

export const putDiagnosisRealtimeParamsset = (param) => {
    const user = getUser();
    return putT(Interface.diagnosis_realtime_paramsset, { username: user.username, ...param });
};

export const postDiagnosisRecord = (param) => {
    const user = getUser();
    return postT(Interface.diagnosis_record, { username: user.username, ...param });
};

export const getDiagnosisRecord = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.diagnosis_record, { username: user.username, ...param });
    return getT(queryString);
};

export const getDiagnosisSysconfig = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.diagnosis_sysconfig, { username: user.username, ...param });
    return getT(queryString);
};

export const getDiagnosisRecordHistoryPage = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.diagnosis_record_history_page, { username: user.username, ...param });
    return getT(queryString);
};

export const postDiagnosisRealtimeStart = (param) => {
    const user = getUser();
    return postT(Interface.diagnosis_realtime_start, { username: user.username, ...param });
};

export const postDiagnosisRealtimeEnd = (param) => {
    const user = getUser();
    return postT(Interface.diagnosis_realtime_end, { username: user.username, ...param });
};

export const postDiagnosisRecordEnd = (param) => {
    const user = getUser();
    return postT(Interface.diagnosis_record_end, { username: user.username, ...param });
};

export const postDiagnosisRecordCancel = (param) => {
    const user = getUser();
    return postT(Interface.diagnosis_record_cancel, { username: user.username, ...param });
};

export const getControlUrlCommonFile = (param) => {
    const user = getUser();
    const queryString = getQueryString(Interface.controlUrl_common_file, { username: user.username, ...param });
    return getT(queryString);
};

export const findFeedbacks = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.find_feedbacks}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const withdrawFeedback = (param) => {
    const user = getUser();
    return putT(Interface.withdraw_feedback, { username: user.username, ...param });
};

export const addFeedback = (param) => {
    const user = getUser();
    return postT(`${Interface.add_feedback}`, { ...param, username: user.username });
};

export const getInvoicableOrder = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.get_invoicable_order}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const findInvoice = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.find_invoice}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const getInvoiceDetail = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.get_invoice_detail}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const applyInvoice = (param) => {
    const user = getUser();
    return postT(`${Interface.apply_invoice}`, { ...param, username: user.username });
};

export const applyElecInvoice = (param) => {
    const user = getUser();
    return postT(`${Interface.apply_elec_invoice}`, { ...param, username: user.username });
};

export const findInvoiceTitle = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.find_invoice_title}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const addInvoiceTitle = (param) => {
    const user = getUser();
    return postT(`${Interface.add_invoice_title}`, { ...param, username: user.username });
};

export const deleteInvoiceTitle = (param) => {
    const user = getUser();
    return delT(Interface.delete_invoice_title, { ...param, username: user.username });
};

export const editInvoiceTitle = (param) => {
    const user = getUser();
    return putT(Interface.edit_invoice_title, { username: user.username, ...param });
};

// 工艺库
export const processstoreAdminsetAll = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processstore_adminset_all}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const postProcessstoreAdminsetOne = (param) => {
    const user = getUser();
    return postT(`${Interface.processstore_adminset_one}`, { ...param, username: user.username });
};

export const delProcessstoreAdminsetOne = (param) => {
    const user = getUser();
    return delT(`${Interface.processstore_adminset_one}`, { ...param, username: user.username });
};

export const processstoreProcesslibShareduserBypage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processstore_processlib_shareduser_bypage}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const postProcessstoreProcesslibShareduser = (param) => {
    const user = getUser();
    return postT(`${Interface.processstore_processlib_shareduser}`, { ...param, username: user.username });
};

export const delProcessstoreProcesslibShareduser = (param) => {
    const user = getUser();
    return delT(`${Interface.processstore_processlib_shareduser}`, { ...param, username: user.username });
};

export const processstoreOperatelogBypage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processstore_operatelog_bypage}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

// 获取工艺库
export const getProcessLibByPage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processlib_bypage}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const getProcessLibList = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processlib_list}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};
export const getProcessLibDetail = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processlib_one}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};
// 停用工艺库
export const postOffProcesslib = (param) => {
    const user = getUser();
    return putT(`${Interface.processlib_off}`, { ...param, username: user.username });
};
export const postOnProcesslib = (param) => {
    const user = getUser();
    return putT(`${Interface.processlib_on}`, { ...param, username: user.username });
};
export const postNewProcesslib = (param) => {
    const user = getUser();
    return postT(`${Interface.processlib_one}`, { ...param, username: user.username });
};
export const putUpdateProcesslib = (param) => {
    const user = getUser();
    return putT(`${Interface.processlib_one}`, { ...param, username: user.username });
};
export const delProcesslib = (param) => {
    const user = getUser();
    return delT(`${Interface.processlib_one}`, { ...param, username: user.username });
};
// 工艺文件
// 获取工艺文件详情
export const getProcessFileDetail = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processfile_bypage}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

// 获取工艺文件列表
export const getProcessFileList = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processfile_list}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

// 获取工艺文件列表 分页
export const getProcessFileListByPage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processfile_bypage}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

// 获取工艺文件列表 分页
export const getProcessFileFavorList = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processfile_favorlist}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

// 添加工艺文件 导入
export const addProcessFileByImport = (param) => {
    const user = getUser();
    return postT(`${Interface.processfile_import}`, { ...param, username: user.username });
};
// 添加工艺文件 上传
export const addProcessFileByUpload = (param) => {
    const user = getUser();
    return postT(`${Interface.processfile_upload}`, { ...param, username: user.username });
};
// 更新工艺文件信息
export const updateProcessfile = (param) => {
    const user = getUser();
    return putT(`${Interface.processfile_one}`, { ...param, username: user.username });
};

export const delProcessfile = (param) => {
    const user = getUser();
    return delT(`${Interface.processfile_one}`, { ...param, username: user.username });
};

export const addProcessfileFavor = (param) => {
    const user = getUser();
    return postT(`${Interface.processfile_addfavor}`, { ...param, username: user.username });
};

export const removeProcessfileFavor = (param) => {
    const user = getUser();
    return delT(`${Interface.processfile_removefavor}`, { ...param, username: user.username });
};

export const getProcessLibAppAuth = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processfile_appauth}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const getProcessLibAuth = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.processfile_libauth}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const statisticsMemberandrepair = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.statistics_memberandrepair}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const statisticsCustomerandrepair = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.statistics_customerandrepair}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const statisticsDailyhistory = (param) => {
    const user = getUser();

    const queryUrl = getQueryString(`${Interface.statistics_dailyhistory}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const editPorductArchive = (param) => {
    const user = getUser();

    return putT(`${Interface.productarchive}`, { username: user.username, ...param });
};

export const newPorductArchive = (param) => {
    const user = getUser();

    return postT(`${Interface.productarchive}`, { username: user.username, ...param });
};

export const getPorductArchiveOptLog = (param) => {
    const user = getUser();

    const queryString = getQueryString(`${Interface.productarchive_logs}`,
        {
            username: user.username,
            ...param
        });
    return getT(queryString);
};

export const getPorductArchiveOne = (param) => {
    const user = getUser();

    const queryString = getQueryString(`${Interface.productarchive_one}`,
        {
            username: user.username,
            ...param
        });
    return getT(queryString);
};

export const deletePorductArchiveOne = (param) => {
    const user = getUser();

    return delT(`${Interface.productarchive_one}`, {
        username: user.username,
        ...param
    });
};

export const getPorductArchiveGroup = (param) => {
    const user = getUser();

    const queryString = getQueryString(`${Interface.productarchive_group}`, { username: user.username, ...param });

    return getT(queryString);
};

export const getPorductArchiveDevices = (param) => {
    const user = getUser();

    const queryString = getQueryString(`${Interface.productarchive_devices}`, { username: user.username, ...param });

    return getT(queryString);
};

export const getPorductArchiveDevicesNoPa = (param) => {
    const user = getUser();

    const queryString = getQueryString(`${Interface.productarchive_devices_nopa}`, { username: user.username, ...param });

    return getT(queryString);
};

export const dataanalysisUserAll = (param) => {
    const queryUrl = getQueryString(`${Interface.dataanalysis_user_all}`, {
        ...param
    });
    return getT(queryUrl);
};

export const dataanalysisDeviceAll = (param) => {
    const queryUrl = getQueryString(`${Interface.dataanalysis_device_all}`, {
        ...param
    });
    return getT(queryUrl);
};

export const weixinAlluser = (param) => {
    const queryUrl = getQueryString(`${Interface.weixin_alluser}`, {
        ...param
    });
    return getT(queryUrl);
};

export const postMaintainctrlCustomrosterCustomparams = (param) => {
    const user = getUser();
    return postT(`${Interface.maintainctrl_customroster_customparams}`, { ...param, username: user.username });
};

export const postMaintainctrlCustomrecord = (param) => {
    const user = getUser();
    return postT(`${Interface.maintainctrl_customrecord}`, { ...param, username: user.username });
};

export const putMaintainctrlCustomrecord = (param) => {
    const user = getUser();
    return putT(`${Interface.maintainctrl_customrecord}`, { ...param, username: user.username });
};

export const getMaintainctrlCustomrecordBypage = (param) => {
    const user = getUser();

    const queryUrl = getQueryString(`${Interface.maintainctrl_customrecord_bypage}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};
export const getMaintainctrlCustomrecordList = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_customroster_list}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const getMaintainctrlCustomrecordOne = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_customrecord_one}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const delMaintainctrlCustomrecordOne = (param) => {
    const user = getUser();
    return delT(`${Interface.maintainctrl_customrecord_one}`, { ...param, username: user.username });
};

export const getMaintainctrlCustomrosterCustomparams = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_customroster_customparams}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const getMaintainctrlCustomrosterOptlogs = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_customroster_optlogs}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const delMaintainctrlCustomrosterCustomparam = (param) => {
    const user = getUser();
    return delT(`${Interface.maintainctrl_customroster_customparam}`, { ...param, username: user.username });
};

export const postMaintainctrlCustomrecordGetsearchlog = (param) => {
    const user = getUser();
    return postT(`${Interface.maintainctrl_customrecord_getsearchlog}`, { ...param, username: user.username });
};

export const getMaintainRepairAllMidctrl = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintain_repair_all_midctrl}`, {
        ...param,
        username: user.username
    });
    return getT(queryUrl);
};

export const getUserEnterprises = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.enterprise_member_myents}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const getEnterpriseMaintainMembers = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.enterprise_maintainmember_list}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const getEnterpriseMembers = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.enterprise_member_list}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const newEnterpriseMember = (param) => {
    const user = getUser();

    return postT(`${Interface.enterprise_member_one}`, {
        username: user.username,
        ...param
    });
};

export const editEnterpriseMember = (param) => {
    const user = getUser();

    return putT(`${Interface.enterprise_member_one}`, {
        username: user.username,
        ...param
    });
};

export const getEnterpriseMember = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.enterprise_member_one}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const getEnterpriseMembersByPage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.enterprise_member_page}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const delEnterpriseMemberOne = (param) => {
    const user = getUser();
    return delT(Interface.enterprise_member_one, { username: user.username, ...param });
};

export const getEnterpriseMarkinfo = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.enterprise_markinfo}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const putMemberClock = (param) => {
    const user = getUser();
    return postT(Interface.maintainctrl_markrecord, {
        username: user.username,
        ...param
    });
};

export const getMarkRecordByPage = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_markrecord_bypage}`, {
        username: user.username,
        ...param
    });
    return getT(queryUrl);
};

export const changeEnterpriseOwner = (param) => {
    const user = getUser();
    return putT(Interface.enterprise_owner_change, {
        username: user.username,
        ...param
    });
};

export const getMaintainctrlStatistic = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(Interface.maintainctrl_statistics, {
        username: user.username,
        ...param
    });

    return getT(queryUrl);
};
// weplus
export const pcAccountLogin = param => {
    return post(Interface.login_byaccount, { ...param });
};
export const pcPhoneLogin = param => {
    return post(Interface.login_byphone, { ...param });
};
export const getRepairForStaff = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_getrepair_bystaff}`, { ...param, username: user.username });
    return getT(queryUrl);
};
// maintainctrl_getrepair_bycustomer
export const getRepairForUser = (param) => {
    // const user = getUser();
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_getrepair_bycustomer}`, { ...param, username: user.username });
    return getT(queryUrl);
};
export const addRepair = param => {
    return post(Interface.maintainctrl_addrepair, { ...param });
};
export const getManufactureCodeDetail = param => {
    return post(Interface.manufacture_code_detail, { ...param });
};
export const getOneRepair = (param) => {
    // const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_getonerepair}`, { ...param });
    return getT(queryUrl);
};
export const geRepairReview = (param) => {
    const queryUrl = getQueryString(`${Interface.maintainctrl_getrepairreview}`, { ...param });
    return getT(queryUrl);
};
export const PostReview = param => {
    const user = getUser();
    return postT(Interface.maintainctrl_postrepairreview, { ...param, username: user.username });
};

export const getCustomerAndRepair = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.statistic_customerandrepair}`, { ...param, username: user.username });
    return getT(queryUrl);
};
export const getMemberAndRepair = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.statistic_memberandrepair}`, { ...param, username: user.username });
    return getT(queryUrl);
};
export const getCustomerAndRrepairStatistic = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.statistic_customerandrepair_statistic}`, { ...param, username: user.username });
    return getT(queryUrl);
};

export const getCustomerRepair = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.statistic_customerrepair}`, { ...param, username: user.username });
    return getT(queryUrl);
};

export const getRepairMember = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.statistic_repairmember}`, { ...param, username: user.username });
    return getT(queryUrl);
};
export const getRepairMemberDetail = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.statistic_repairmemberdetail}`, { ...param, username: user.username });
    return getT(queryUrl);
};
export const getStatisticsMapData = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.statistic_map}`, { ...param, username: user.username });
    return getT(queryUrl);
};
export const RepairDispatch = param => {
    return postT(Interface.maintainctrl_repairdispatch, { ...param });
};
export const RepairAccept = param => {
    return postT(Interface.maintainctrl_repairaccept, { ...param });
};
export const RepairTransfer = param => {
    return postT(Interface.maintainctrl_repairtransfer, { ...param });
};
export const getRepairRecord = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_repairrecord}`, { ...param, username: user.username });
    return getT(queryUrl);
};
export const getRepairType = () => {
    // const user = getUser();
    // const queryUrl = getQueryString(`${Interface.maintainctrl_repairtype}`);
    const queryUrl = getQueryString(`${Interface.maintainctrl_repairtypeoptions}`);
    return getT(queryUrl);
};
export const checkWxLogin = (param) => {
    const queryUrl = getQueryString(`${Interface.login_check}`, { ...param });

    return getT(queryUrl);
}
;
export const SearchManuCode = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_manucode}`, { ...param, username: user.username });
    return getT(queryUrl);
};
export const refreshrecord = (param) => {
    const user = getUser();

    return putT(`${Interface.maintainctrl_refrehrecord}`, {
        username: user.username,
        ...param
    });
};
export const SolutionMode = (param) => {
    // const user = getUser();
    //  const queryUrl = getQueryString(`${Interface.maintainctrl_solutionmode}`);
    // maintainctrl_solutionmodeoptions
    const queryUrl = getQueryString(`${Interface.maintainctrl_solutionmodeoptions}`);
    return getT(queryUrl);
};
export const ServiceMode = (param) => {
    // const user = getUser();
    // const queryUrl = getQueryString(`${Interface.maintainctrl_servicemode}`);
    // maintainctrl_servicemodeoptions
    const queryUrl = getQueryString(`${Interface.maintainctrl_servicemodeoptions}`);
    return getT(queryUrl);
};
export const RepairHandle = param => {
    const user = getUser();
    return postT(Interface.maintainctrl_handlerepair, { ...param, username: user.username });
};
export const getRepairBymanucode = (param) => {
    // const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_manucodequery}`, { ...param });
    return getT(queryUrl);
};
export const getRepairByphone = (param) => {
    // const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_phonequery}`, { ...param });
    return getT(queryUrl);
};
export const getRepairByUser = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.maintainctrl_getrepair_byuser}`, { ...param, username: user.username });
    return getT(queryUrl);
};
export const getRepairVercode = (param) => {
    const queryUrl = getQueryString(`${Interface.maintainctrl_getvercode}`, { ...param });
    return getT(queryUrl);
};
export const getPrdArchByManucode = (param) => {
    const queryUrl = getQueryString(`${Interface.maintainctrl_getarchivebymanucode}`, { ...param });
    return getT(queryUrl);
};

export const getPersonalRepair = (param) => {
    const queryUrl = getQueryString(`${Interface.statistic_personal_repair}`, { ...param });
    return getT(queryUrl);
};

export const getPersonalPerformance = (param) => {
    const queryUrl = getQueryString(`${Interface.statistic_personal_performance}`, { ...param });
    return getT(queryUrl);
};

export const postLogout = (param) => {
    return postT(Interface.logout_wx, { ...param });
};

export const getProductManualTags = (param) => {
    const queryUrl = getQueryString(`${Interface.maintainctrl_tags}`, { ...param });
    return getT(queryUrl);
};

export const searchProductManualList = (param) => {
    return postT(`${Interface.product_manual_overview}`, { ...param });
};

export const getProductDetailById = (param) => {
    const queryUrl = getQueryString(`${Interface.product_manual_detail}`, { ...param });
    return getT(queryUrl);
};

export const getProductManualConfig = (param) => {
    const queryUrl = getQueryString(`${Interface.product_manual_config}`, { ...param });
    return getT(queryUrl);
};
// 编辑工单详情
export const putRepairdetail = (param) => {
    const user = getUser();
    return putT(Interface.maintainctrl_editonerepair, { ...param, username: user.username });
};
// 邀请评价
export const inviteEvaluate = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.invite_evaluate}`, { ...param, username: user.username, language: user.lang });
    return getT(queryUrl);
};

export const getProductManualUuid = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.product_manual_uuid}`, { ...param, username: user.username });
    return getT(queryUrl);
};

export const getProductManualByPaid = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.product_manual_bypaid}`, { ...param, username: user.username });
    return getT(queryUrl);
};

export const getProductArchiveRemoteCode = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.remotecode_one}`, { ...param, username: user.username });
    return getT(queryUrl);
};

export const getProductarchiveByaddressDetail = (param) => {
    const user = getUser();
    return postT(`${Interface.productarchive_byaddress_detail}`, { ...param, username: user.username });
};

export const getAllProductarchiveByaddress = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.productarchive_byaddress}`, { ...param, username: user.username });
    return getT(queryUrl);
};

export const getProductarchiveAddress = (param) => {
    const user = getUser();
    const queryUrl = getQueryString(`${Interface.productarchive_address}`, { ...param, username: user.username });
    return getT(queryUrl);
};

export const getProductarchiveByparam = (param) => {
    const user = getUser();
    return postT(`${Interface.productarchive_byparam}`, { ...param, username: user.username });
};

// 根据uuid获取设备信息
export const getDevicebyuuid = (param) => {
    const user = getUser();
    // const queryUrl = getQueryString(`${Interface.maintainctrl_getdevicebyuuid}`, { ...param, username: user.username });
    return postT(`${Interface.maintainctrl_getdevicebyuuid}`, { ...param, username: user.username });
    // return postT(queryUrl);
};
// 获取处理工单时间/faultrepair/timestatistics
export const getrepairtimebyid = (param) => {
    const user = getUser();
    // const queryUrl = getQueryString(`${Interface.maintainctrl_getdevicebyuuid}`, { ...param, username: user.username });
    return postT(`${Interface.maintainctrl_getrepairtime}`, { ...param, username: user.username });
    // return postT(queryUrl);
};
// 获取维检工单列表
export const getMaintainexamDataList = (param) => {
    const user = getUser();
    return postT(`${Interface.maintain_check_getlist}`, { ...param, username: user.username });
};
// 获取维检工单详情
export const getMaintainexamOrderDetail = (param) => {
    const user = getUser();
    return postT(`${Interface.maintaincheckorder_detail}`, { ...param, username: user.username });
};
// 获取操作记录
export const postMaintainchecklog = (param) => {
    const user = getUser();
    return postT(`${Interface.maintaincheckorder_getlog}`, { ...param, username: user.username });
};
export const getPointInspectionContentsParams = (param) => {
    const user = getUser();
    return postT(`${Interface.get_point_inspection_contents_params}`, { username: user.username });
};
// 工单点检结果
export const getPointInspectionResultParams = (param) => {
    const user = getUser();
    return postT(`${Interface.get_point_inspection_result_params}`, { username: user.username });
};
export const getDeviceCheckRecord = (param) => {
    const user = getUser();
    return postT(`${Interface.get_devicecheck_record}`, { ...param, username: user.username });
};
export const postUpdateDeviceCheckRecord = (param) => {
    const user = getUser();
    return postT(`${Interface.post_devicecheck_updaterecord}`, { ...param, username: user.username });
};
export const postMaintainchecktransfer = (param) => {
    const user = getUser();
    return postT(`${Interface.maintaincheckorder_transfer}`, { ...param, username: user.username });
};
export const maintainworkorderFinish = (param) => {
    const user = getUser();
    return postT(`${Interface.maintainworkorder_finish}`, { ...param, username: user.username });
};
export const maintainworkorderAccepting = (param) => {
    const user = getUser();
    return postT(`${Interface.maintainworkorder_accepting}`, { ...param, username: user.username });
};
